Last active
December 30, 2015 17:19
-
-
Save vitormil/7860560 to your computer and use it in GitHub Desktop.
/etc/init/<file>.conf
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
description "Myapp web application" | |
start on starting myapp | |
stop on stopping myapp | |
respawn | |
exec su - myapp -c 'cd /var/www/myapp/current/ && bundle exec unicorn -c ./config/unicorn.rb --env production >> /var/log/myapp/web.log 2>&1' |
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
description "Myapp worker" | |
start on starting myapp | |
stop on stopping myapp | |
respawn | |
exec su - myapp -c 'cd /var/www/myapp/current/ && bundle exec sidekiq >> /var/log/myapp/worker.log 2>&1' |
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
description "Myapp web application" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
pre-start script | |
mkdir -p /var/log/myapp | |
chown -R myapp. /var/log/myapp | |
mkdir -p /var/run/myapp | |
chown -R myapp. /var/run/myapp | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment