Skip to content

Instantly share code, notes, and snippets.

@vlasikhin
Forked from rusllonrails/SIDEKIQ RUNIT
Created April 24, 2023 09:15
Show Gist options
  • Save vlasikhin/cf4f642523f73e504767d5ab1a3103c2 to your computer and use it in GitHub Desktop.
Save vlasikhin/cf4f642523f73e504767d5ab1a3103c2 to your computer and use it in GitHub Desktop.
SIDEKIQ RUNIT

sudo apt-get install runit

cd /etc/sv/ mkdir sidekiq cd sidekiq

nano run

#!/bin/sh
cd /home/deployer/application/current/
exec 2>&1
exec chpst -udeployer bundle exec sidekiq -e production -P /home/deployer/application/current/tmp/pids/sidekiq.pid -L /home/qeployer/application/current/log/sidekiq.log

/etc/sv/sidekiq# chmod 755 run

ln -s /etc/sv/sidekiq /etc/service/sidekiq sudo reboot

cd /etc/sv/sidekiq/
chmod 755 supervise/
chown deployer ./supervise/ok ./supervise/control ./supervise/status

Check status:

sv status sidekiq 
sv check sidekiq

Runit Log can be checked at:

/var/log/upstart/runsvdir.log

More details at http://smarden.org/runit/faq.html#user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment