-
-
Save ByteDecoder/8b7104a802cc66713ba73bf7e06261d3 to your computer and use it in GitHub Desktop.
systemd unit files for multiple sidekiq workers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Sidekiq workers | |
# start as many workers as you want here | |
[email protected] | |
[email protected] | |
# ... | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/true | |
RemainAfterExit=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Sidekiq worker %I | |
# restarts/stops with sidekiq | |
PartOf=sidekiq.service | |
After=network.target | |
[Service] | |
User=app | |
Group=app | |
UMask=0002 | |
WorkingDirectory=/app | |
ExecStart=/app/bin/sidekiq -C config/sidekiq.yml -i "%I" -e production | |
# restart & stop send TERM to main process, wait up to 30 seconds, then KILL if still running | |
KillMode=mixed | |
TimeoutStopSec=30 | |
# restart on non-zero exit or other failure after 5 seconds | |
Restart=on-failure | |
RestartSec=5 | |
# don't create a new systemd.slice per instance | |
Slice=system.slice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment