Not logged in. Login

Railsunicornupstart

workaround-vagrant-bug-6074.conf:

# workaround for https://github.com/mitchellh/vagrant/issues/6074
start on filesystem
task

env MOUNTPOINT=/home/vagrant/project

script
  until mountpoint -q $MOUNTPOINT; do sleep 1; done
  /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=$MOUNTPOINT
end script

unicorn_rails.conf:

description "Unicorn for Rails"

# http://razius.com/articles/launching-services-after-vagrant-mount/
start on vagrant-mounted
stop on runlevel [!2345]

env RAILS_ENV=production
env RACK_ENV=production

setuid vagrant
setgid vagrant
chdir /home/vagrant/project/blog

pre-start script
  exec bundle exec unicorn -c config/unicorn.rb -E $RAILS_ENV -D
end script

post-stop script
  exec kill `cat /home/vagrant/unicorn.pid`
end script
Updated Mon Aug. 30 2021, 07:36 by ggbaker.