Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (e.g. crash_dump, dmesg etc.)

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

Any clues?

like image 977
jldupont Avatar asked Apr 26 '26 20:04

jldupont


1 Answers

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.

like image 54
John Kugelman Avatar answered Apr 29 '26 10:04

John Kugelman