Skip to content

Instantly share code, notes, and snippets.

@mjquinlan2000
Last active May 17, 2017 16:04
Show Gist options
  • Save mjquinlan2000/cc2165a301f5cd5fd51d0ef5fab300ec to your computer and use it in GitHub Desktop.
Save mjquinlan2000/cc2165a301f5cd5fd51d0ef5fab300ec to your computer and use it in GitHub Desktop.
This is for maintaining a process started by an erlang process (such as phoenix applications built with distillery and/or delivered with edeliver)
[Unit]
Description=my_app
After=network.target
[Service]
User=ubuntu
Group=ubuntu
Restart=on-failure
Type=forking
Environment=HOME=/home/ubuntu
EnvironmentFile=/home/ubuntu/env_vars.env
ExecStart= /var/www/my_app/bin/my_app start
ExecStop= /var/www/my_app/bin/my_app stop
[Install]
WantedBy=multi-user.target
sudo systemctl enable my_app
sudo systemctl start my_app
sudo systemctl status my_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment