简体   繁体   中英

Erlang: daemon 'init.d' script fails to start

I have a python script which manages an Erlang daemon. Everything works fine when used through a shell once the system is initialized.

Now, when I included the same script under "/etc/init.d" and with the symlinks properly set in "/etc/rcX.d", the python script still works but my Erlang daemon fails to start and leaves no discernible traces (eg crash_dump, dmesg etc.)

I also tried setting the environment variable "HOME" through 'erl -env HOME /root' and still no luck.

Any clues?

To manually run the script the same way the system does, use service daemon start if you have that command, or else try

cd /
env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" /etc/init.d/daemon start

That forces the script to run with a known, minimal environment just like it would at startup.

Thanks for this answer - I was having a devil of a time starting the "Alice" RESTful interface to rabbitmq on startup. The key was using 'env HOME=/root /path/to/alice/startup/script' in my init script.

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