[英]Permission denied, forever.js as a bash script?
So I figured out how to run forever in a bash script, in filezilla I changed all permissions for /usr/local/lib/node_modules/forever
to 777. 所以我想出了如何在bash脚本中永久运行的方法,在filezilla中,我将
/usr/local/lib/node_modules/forever
所有权限更改为777。
post-receive bash script 接收后bash脚本
#!/bin/sh
git --work-tree=/var/www/example.io/public_html --git-dir=/var/repo/example.git checkout -f
/usr/local/lib/node_modules/forever restart ../../../www/example.io/public_html/server.js
Then when I push it writes successfully but I get this 然后当我推动它写入成功但是我得到了这个
remote: hooks/post-receive: 3: hooks/post-receive: /usr/local/lib/node_modules/forever: Permission denied
So since I changed all folders to 777, what else can I do? 因此,由于我将所有文件夹都更改为777,该怎么办?
So in the bash script the forever command works just like this 所以在bash脚本中,永远的命令就像这样工作
forever restart server.js
No paths involved, the only caveat is it restarts all server.js processes, so I would need to name my node servers accordingly. 不涉及任何路径,唯一的警告是它将重新启动所有server.js进程,因此我需要相应地命名节点服务器。
Also changed my remote server to root. 也将我的远程服务器更改为root。 All is working now.
现在一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.