mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
added upstart script for Discourse
This commit is contained in:
parent
7df4e4afb9
commit
c954807a63
36
config/unicorn_upstart.conf
Normal file
36
config/unicorn_upstart.conf
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# you can copy this file to /etc/init/discourse.conf and then start discourse with
|
||||||
|
# initctl start discourse
|
||||||
|
|
||||||
|
# It assumes Discourse is installed at /var/www/discourse
|
||||||
|
# It assumes Discourse is running under the discourse user
|
||||||
|
# It assumes an rvm based setup
|
||||||
|
|
||||||
|
description "Unicorn upstart for discourse"
|
||||||
|
|
||||||
|
stop on runlevel [06]
|
||||||
|
|
||||||
|
setuid discourse
|
||||||
|
setgid discourse
|
||||||
|
|
||||||
|
respawn
|
||||||
|
respawn limit 3 30
|
||||||
|
|
||||||
|
|
||||||
|
script
|
||||||
|
|
||||||
|
exec /bin/bash <<'EOT'
|
||||||
|
|
||||||
|
# set HOME to the setuid user's home, there doesn't seem to be a better, portable way
|
||||||
|
export HOME="$(eval echo ~$(id -un))"
|
||||||
|
export RAILS_ENV=production
|
||||||
|
export RUBY_GC_MALLOC_LIMIT=90000000
|
||||||
|
|
||||||
|
cd /var/www/discourse
|
||||||
|
|
||||||
|
source "$HOME/.rvm/scripts/rvm"
|
||||||
|
|
||||||
|
exec bundle exec unicorn -c config/unicorn.conf.rb
|
||||||
|
EOT
|
||||||
|
|
||||||
|
end script
|
||||||
|
|
Loading…
Reference in New Issue
Block a user