Here are examples of Upstart jobs (Ubuntu) and Systemd units (RHEL7, Arch, CoreOS).
They should be complete enough to get you started.
There are some shell commands needed in each case too:
...
; /etc/systemd/system/convos-frontend.service | |
[Unit] | |
Description=Convos Frontend | |
Requires=convos.service | |
After=convos.service | |
[Service] | |
User=eric | |
WorkingDirectory=/home/eric/convos | |
ExecStart=/home/eric/convos/vendor/bin/carton exec script/convos frontend start --listen http://*:31373 | |
Type=forking | |
UMask=0002 | |
[Install] | |
WantedBy=multi-user.target |
# /etc/init/camlistored.conf | |
description "camlistored" | |
start on started networking | |
stop on runlevel [!2345] | |
setuid eric | |
setgid eric | |
env USER=eric | |
env HOME=/home/eric | |
script | |
export PATH=$HOME/bin/:$PATH | |
camlistored | |
end script |