You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wanted to briefly sum up what does and does not work when using systemd to start up sidekiq as explained in the Readme. Getting it to work required quite a bit of trial and error and this could save time to other people trying to set it up:
The service template file generated by following the official instructions does work (ie can successfully start a sidekiq process) but only once setting :bundler_path to a value appropriate for your system (the default value might work for some, but as least not when using rbenv).
The default service file template will not use :sidekiq_config, so it's up to you to specify the correct absolute path to your config file in the service file in the line starting with ExecStart with the -C option (and if intending to use monit as well adding --pidfile might be useful too).
Options such as :sidekiq_processes won't be used in conjunction with :init_system, :systemd, so it's up to you to duplicate the service file for each new process to make it work (haven't tried that one as I only needed one process).
If you're using monit, the default monit task won't be suitable for use with systemd, so you'll need to edit that too. I've managed to make it work with something like start program = "/bin/su - deploy -c '/bin/systemctl --user start sidekiq-production'" but I don't know if there's a better way (the su trick is only necessary because it's a user service, it might be much simpler when using a system service).
Hope this helps.
The text was updated successfully, but these errors were encountered:
While systemd is the best way to ensure that sidekiq and other processes are running and keep running after a failure or a system reboot, monit has some interesting features from a sysadmin and debugging standpoint:
A web interface that lists which processes are running and for how long (useful when troubleshooting an issue) with the ability to stop or restart them if needed.
An alerting system that can send an email notification when something specific happens (process reboots more than X times in the past Y minutes, ...).
There might be some more reasons to use monit but for me these two alone justify its use alongside systemd.
I just wanted to briefly sum up what does and does not work when using systemd to start up sidekiq as explained in the Readme. Getting it to work required quite a bit of trial and error and this could save time to other people trying to set it up:
The service template file generated by following the official instructions does work (ie can successfully start a sidekiq process) but only once setting
:bundler_path
to a value appropriate for your system (the default value might work for some, but as least not when using rbenv).The default service file template will not use
:sidekiq_config
, so it's up to you to specify the correct absolute path to your config file in the service file in the line starting with ExecStart with the -C option (and if intending to use monit as well adding --pidfile might be useful too).Options such as
:sidekiq_processes
won't be used in conjunction with:init_system, :systemd
, so it's up to you to duplicate the service file for each new process to make it work (haven't tried that one as I only needed one process).If you're using monit, the default monit task won't be suitable for use with systemd, so you'll need to edit that too. I've managed to make it work with something like
start program = "/bin/su - deploy -c '/bin/systemctl --user start sidekiq-production'"
but I don't know if there's a better way (the su trick is only necessary because it's a user service, it might be much simpler when using a system service).Hope this helps.
The text was updated successfully, but these errors were encountered: