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
Systemd integration #171
Systemd integration #171
Conversation
* start/stop/quiet tasks as systemd wrappers
* systemd.service template * sidekiq:install task to install and enable service template * sidekiq:uninstall to disable and remove
This looks good to me. systemd integration is a pretty hot topic on various gists and the sidekiq wiki. Implementing this in the gem would make this dead simple. |
Environment=RAILS_ENV=<%= fetch(:rails_env) %> | ||
WorkingDirectory=<%= fetch(:deploy_to) %>/current | ||
ExecStart=<%= fetch(:bundler_path, '/usr/local/bin/bundler') %> exec sidekiq -e <%= fetch(:rails_env) %> | ||
ExecReload=/bin/kill -USR1 $MAINPID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this should be ExecReload=/bin/kill -TSTP $MAINPID
(TSTP instead of USR1) for Sidekiq 5. https://github.com/mperham/sidekiq/wiki/Signals#tstp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
This would be really nice. +1 |
Type=simple | ||
Environment=RAILS_ENV=<%= fetch(:rails_env) %> | ||
WorkingDirectory=<%= fetch(:deploy_to) %>/current | ||
ExecStart=<%= fetch(:bundler_path, '/usr/local/bin/bundler') %> exec sidekiq -e <%= fetch(:rails_env) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert on systemd, but it seems that ExecStart is not taking into consideration sidekiq.yml config file, right? Since this is oficially supported by the gem via the set :sidekiq_config
option (see https://github.com/seuros/capistrano-sidekiq/wiki), I think it should be supported here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? This just call bundle exec sidekiq
via systemd, it should be some sort of an equivalent to cap sidekiq:start
. Nothing less, nothing more.
I have an idea to add a generator for this file, which can solve some issue. In the mean time, this is just a template for a service file and you can customize the resulting systemd service file to your liking.
Lets get this merged, we need this... |
👏 |
Add ability to run sidekiq daemon via systemd. Closes #51