문제

I have written the following:

#! /bin/sh
# /etc/init.d/bootForever
#

forever start /usr/local/src/mean/myapp/app.js

to the /etc/init.d/bootForever

I ran sudo chmod 755 /etc/init.d/bootForever followed by sudo update-rc.d bootForever defaults and the exitted the VM and ran vagrant reload. No joy.

SSHed back into the VM and ran `/etc/init.d/bootForever' directly in the command line, which had the effect I was after.

Why would this script not function during the VM boot, but work once booted? Is it an issue of timing? Can I ensure the script is ran at the very end?

VM Spec: http://files.vagrantup.com/precise64.box

도움이 되었습니까?

해결책

Have you tried using absolute paths to the forever binary?

eg:

#! /bin/sh
# /etc/init.d/bootForever
#

/usr/bin/forever start /usr/local/src/mean/myapp/app.js

Replace /usr/bin with where forever is located, which can usually be found by using the whereis or locate command.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top