<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div data-crea="font-wrapper" style="font-family: Tahoma; font-size: 16px; direction: ltr"><div style="font-family: Tahoma; font-size: 16px"></div>Hi Tobias,<div><br></div><div>thanks a lot for your example, I appreciate it very much!</div><div>In fact, I wanted to ask in my first email for other solutions and feedback, but then hit the send button too early..</div><div><br></div><div>My release is a standalone application, so a separate epmd-systemd unit is not important for me.</div><div>But you probably have a distributed solution with several releases/nodes per machine where this approach</div><div>clearly is superior.</div><div><br></div><div>Kind regards,</div><div>Dieter</div><div><br><div></div><br><br><div data-anchor="reply-title">Am Mi., Sept. 19, 2018 11:16 schrieb Tobias Schlager <tobias.schlager@lindenbaum.eu>:</div><blockquote><div>Hi Dieter,<br><br>we've been using Erlang releases with Systemd on CentOS for quite some time now. No critics here, I just want to seize the opportunity and point out the solution we use:<br><br>We compile Erlang/OTP ourselves using the '--enable-systemd' option. We package epmd as a separate RPM with a proper service file. In our own service files we do not rely on the rebar start scripts. Instead, we are using erlexec directly, e.g.<br><br>$ systemctl cat epmd.service<br>[Unit]<br>Description=Erlang Port Mapper Daemon<br>After=network-online.target<br>Wants=network-online.target<br><br>[Service]<br>ExecStart=/usr/bin/epmd<br>Restart=always<br>RestartSec=2<br>Type=simple<br>StandardOutput=journal<br>StandardError=journal<br><br>[Install]<br>WantedBy=multi-user.target<br><br>$ systemctl cat xxx.service<br>[Unit]<br>Description=xxx<br>After=epmd.service network-online.target<br>Wants=epmd.service<br><br>[Service]<br>Environment=BINDIR=/usr/lib64/xxx/erts-9.1/bin<br>Environment=COOKIE=xxx<br>Environment=VERSION=???<br>Environment=EMU=beam<br>Environment=ERL_MAX_PORTS=32768<br>Environment=PROGNAME=xxx<br>Environment=ROOTDIR=/usr/lib64/xxx<br>ExecStart=/usr/lib64/xxx/erts-9.1/bin/erlexec -boot ${ROOTDIR}/releases/${VERSION}/xxx -mode embedded -config ${ROOTDIR}/releases/${VERSION}/sys.config -name xxx -setcookie ${COOKIE} -noinput +K true<br>ExecStop=/usr/lib64/xxx/erts-9.1/bin/escript ${BINDIR}/nodetool -name xxx -setcookie ${COOKIE} stop<br>ExecStop=/bin/sh -c 'while $(kill -0 $MAINPID 2>/dev/null); do sleep 1; done'<br>WorkingDirectory=/usr/lib64/xxx<br>Restart=on-failure<br>RestartSec=2<br><br>[Install]<br>WantedBy=multi-user.target<br><br>Regards<br>Tobias</div></blockquote></div></div></body></html>