jldupont
jldupont

Reputation: 96716

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?

Upvotes: 3

Views: 2044

Answers (2)

Russell Borogove
Russell Borogove

Reputation: 19037

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.

Upvotes: 0

John Kugelman
John Kugelman

Reputation: 361575

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.

Upvotes: 5

Related Questions