Skip to content

Instantly share code, notes, and snippets.

@edrex
Created May 6, 2015 00:55
Show Gist options
  • Save edrex/e2b51e21fc8ccd49f824 to your computer and use it in GitHub Desktop.
Save edrex/e2b51e21fc8ccd49f824 to your computer and use it in GitHub Desktop.
Upstart and Systemd examples

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment