简体   繁体   中英

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.

post-receive bash script

#!/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?

So in the bash script the forever command works just like this

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.

Also changed my remote server to root. All is working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM