Skip to content

Instantly share code, notes, and snippets.

@Joseph-N
Created August 25, 2020 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Joseph-N/6f4e0cfe35dc91b891c11118c8d55151 to your computer and use it in GitHub Desktop.
Save Joseph-N/6f4e0cfe35dc91b891c11118c8d55151 to your computer and use it in GitHub Desktop.
Sidekiq sidekiq.service Fedora + RVM
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
[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