Last active
March 14, 2016 08:15
-
-
Save mostlyobvious/72f562e88d60255d79fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expectations: | |
# | |
# * application code in /srv/myapp/current | |
# * ruby runtime in /srv/myapp/.rubies/ruby-2.3.0 | |
# * unicorn.rb config specifies pid file location to /srv/myapp/current/unicorn.pid and working directory to /srv/myapp/current | |
[Unit] | |
Description=Sample unicorn app | |
[Service] | |
User=myapp | |
WorkingDirectory=/srv/myapp/current | |
KillSignal=SIGQUIT | |
ExecStart=/srv/myapp/.rubies/ruby-2.3.0/bin/bundle exec unicorn -c /srv/myapp/current/unicorn.rb | |
ExecReload=/bin/kill -s USR2 $MAINPID ; /bin/sleep 1 ; /bin/kill -s QUIT $MAINPID | |
Environment=PATH=/srv/myapp/.rubies/ruby-2.3.0/bin:$PATH | |
Restart=on-abnormal | |
PIDFile=/srv/myapp/current/unicorn.pid |
On systemctl start
or at boot time when systemctl enable
issued previously. If it depends on something, that'd be nice to describe in unit file as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When does it start?