diff --git a/examples/systemd/sidekiq.service b/examples/systemd/sidekiq.service index 8e6c9257..e37cebdc 100644 --- a/examples/systemd/sidekiq.service +++ b/examples/systemd/sidekiq.service @@ -1,18 +1,15 @@ # -# systemd unit file for CentOS 7, Ubuntu 15.04 +# systemd unit file for CentOS 7+, Ubuntu 15.04+ # # Customize this file based on your bundler location, app directory, etc. # Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu). # Run: # - systemctl enable sidekiq -# - systemctl {start,stop,restart} sidekiq +# - systemctl {start,stop,restart,reload} sidekiq # # This file corresponds to a single Sidekiq process. Add multiple copies # to run multiple processes (sidekiq-1, sidekiq-2, etc). # -# See Inspeqtor's Systemd wiki page for more detail about Systemd: -# https://github.com/mperham/inspeqtor/wiki/Systemd -# [Unit] Description=sidekiq # start us only once the network and logging subsystems are available, @@ -20,8 +17,13 @@ Description=sidekiq After=syslog.target network.target # See these pages for lots of options: -# http://0pointer.de/public/systemd-man/systemd.service.html -# http://0pointer.de/public/systemd-man/systemd.exec.html +# +# https://www.freedesktop.org/software/systemd/man/systemd.service.html +# https://www.freedesktop.org/software/systemd/man/systemd.exec.html +# +# THOSE PAGES ARE CRITICAL FOR ANY LINUX DEVOPS WORK; read them multiple +# times! systemd is a critical tool for all developers to know and understand. +# [Service] Type=simple WorkingDirectory=/opt/myapp/current @@ -29,6 +31,11 @@ WorkingDirectory=/opt/myapp/current # ExecStart=/bin/bash -lc '/home/deploy/.rbenv/shims/bundle exec sidekiq -e production' # If you use the system's ruby: ExecStart=/usr/local/bin/bundle exec sidekiq -e production + +# use `systemctl reload sidekiq` to send the quiet signal to Sidekiq +# at the start of your deploy process. +ExecReload=/usr/bin/kill -TSTP $MAINPID + User=deploy Group=deploy UMask=0002