I’m using releases, systemd and a service type of ‘forking’. I haven’t tested restarting on crash yet. (What would be a good way of doing that?)
My unit file:
[Unit]
Description=My App
After=network.target
Requires=network.target
[Service]
Type=forking
WorkingDirectory=/home/appuser/app
User=appuser
Group=appuser
Restart=on-failure
RestartSec=5
EnvironmentFile=/home/appuser/env_vars
ExecStart=/bin/bash -c 'PATH=/home/appuser/.asdf/shims:$PATH exec /home/appuser/app/bin/my_app start'
ExecStop=/bin/bash -c 'PATH=/home/appuser/.asdf/shims:$PATH exec /home/appuser/app/bin/my_app stop'
[Install]
WantedBy=multi-user.target
(I’ve installed erlang on the server via asdf so that my releases don’t have to include_erts, and found that I needed to add its shims to PATH.)
Is this “child killing business” why systemd reports a failed state on stop? Is there any way round that?
Relevant commit and discussion at Distillery:
https://github.com/bitwalker/distillery/commit/144ac2bb30f2c42472180a8a9ae0af7f1145903a






















