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
Changes from 5 commits
2eabee0
b2ef031
1cfcfd6
6124926
2217440
798af8d
c88bdf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[Unit] | ||
Description=sidekiq for <%= "#{fetch(:application)} (#{fetch(:stage)})" %> | ||
After=syslog.target network.target | ||
|
||
[Service] | ||
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) %> | ||
ExecReload=/bin/kill -USR1 $MAINPID | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. |
||
ExecStop=/bin/kill -TERM $MAINPID | ||
|
||
RestartSec=1 | ||
Restart=on-failure | ||
|
||
SyslogIdentifier=sidekiq | ||
|
||
[Install] | ||
WantedBy=default.target |
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 tocap 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.