[erlang-questions] run_erl and systemd

Alexander Petrovsky <>
Wed Nov 1 10:10:18 CET 2017


Hi!

Looks like you observe very strange behaviour, we run our erlang release in
OpenStack ubuntu instance, with follow systemd config and everything works
fine:

[Unit]
After=network.target remote-fs.target
Requires=network.target remote-fs.target

[Service]
Type=forking
TimeoutStartSec=0
Restart=always
RestartSec=5
Environment=HOME=/root
ExecStart={SCRIPT} start
ExecStop={SCRIPT} stop

[Install]
WantedBy=multi-user.target

Note that run_erl complain when HOME var is not defined. Also, I suggest
try to get rid of User and Group.

2017-10-31 12:52 GMT+03:00 Ali Sabil <>:

> I tend to use `/proj/myapp/bin/myapp foreground` and avoid run_erl
> altogether.
>
> On Tue, Oct 31, 2017 at 12:27 PM, Rynö Jouni (FMI) <>
> wrote:
>
>> Hi list
>>
>> I have an odd systemd and run_erl issue. This service definition more
>> or less "works" on a "physical" machine, but not on a KVM-virtual
>> machine.
>>
>> [Unit]
>> Description=My node
>> After=network.target
>>
>> [Service]
>> Environment=RUNNER_LOG_DIR=/var/log/myapp
>> Type=forking
>> ExecStartPre=/bin/sleep 60
>> ExecStart=/proj/myapp/bin/myapp start
>> ExecStop=/proj/myapp/bin/myapp stop
>> RestartSec=20
>> Restart=on-failure
>> User=me
>> Group=me
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>> epmd is running and I just try to start it via "systemctl start
>> my.service" from a command line
>>
>> Plus I do get some odd inet_gethost and epmd died errors even in the
>> physical machine, but at least the run_erl starts at some point ...
>>
>>
>> Is there something, that I should do differently or add in the
>> environment?
>> Jouni
>>
>> PS.somehow the init.d shell scripts were easier to debug ...
>>
>> --
>> Jouni Rynö                            mailto://Jouni.Ryno@fmi.fi/
>>                                       http://space.fmi.fi/~ryno/
>>  Finnish Meteorological Institute     http://www.fmi.fi/
>>  Observation services
>>  P.O.BOX 503                          Tel      (+358)-29-5394656
>>  FI-00101 Helsinki                    FAX      (+358)-29-5395703
>>  Finland                              priv-GSM (+358)-50-5302903
>>
>> md5sum(the Ultimate Question of Life, The Universe, and Everything) =
>> 0000000000000000000000000000002A
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Петровский Александр / Alexander Petrovsky,

Skype: askjuise
Phone: +7 931 9877991
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171101/d9bcd553/attachment.html>


More information about the erlang-questions mailing list