Created
August 25, 2020 18:16
-
-
Save Joseph-N/6f4e0cfe35dc91b891c11118c8d55151 to your computer and use it in GitHub Desktop.
Sidekiq sidekiq.service Fedora + RVM
This file contains hidden or 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
check process sidekiq | |
matching "sidekiq" | |
start program = "/bin/systemctl start sidekiq.service" | |
stop program = "/bin/systemctl stop sidekiq.service" | |
if totalmem > 3000 MB for 5 cycles then alert | |
if totalmem > 5000 MB for 5 cycles then restart |
This file contains hidden or 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 | |
After=syslog.target network.target | |
[Service] | |
Type=simple | |
WorkingDirectory=/home/deployer/current | |
ExecStart=/bin/bash -lc '/home/deployer/.rvm/rubies/ruby-2.5.1/bin/bundle exec sidekiq -e production -C config/sidekiq.yml' | |
ExecReload=/bin/kill -TSTP $MAINPID | |
ExecStop=/bin/kill -TERM $MAINPID | |
User=deployer | |
Group=deployer | |
UMask=0002 | |
# if we crash, restart | |
RestartSec=1 | |
#Restart=on-failure | |
Restart=always | |
# output goes to /var/log/syslog | |
StandardOutput=syslog | |
StandardError=syslog | |
# This will default to "bundler" if we don't specify it | |
SyslogIdentifier=sidekiq | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment