Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State of the integration with Systemd #240

Open
danielristic opened this issue Mar 11, 2020 · 3 comments
Open

State of the integration with Systemd #240

danielristic opened this issue Mar 11, 2020 · 3 comments
Assignees

Comments

@danielristic
Copy link

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:

  1. 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).

  2. 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).

  3. 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).

  4. 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.

@ivanovv
Copy link

ivanovv commented Mar 15, 2021

@danielristic quick Q – why do you want to use monit with systemd?

I was under impression that systemd has everything needed to run sidekiq, including a watchdog (supported with sidekiq 6 iirc).

@danielristic
Copy link
Author

danielristic commented Mar 16, 2021

Hey @ivanovv,

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.

@seuros
Copy link
Owner

seuros commented Oct 8, 2022

Can you try with the latest version https://rubygems.org/gems/capistrano-sidekiq/versions/3.0.0.alpha.1

The whole api was refactored .

I will add the monit integration in a future version.

@seuros seuros self-assigned this Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants