mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Add sample systemd unit file, fixes #1532
This commit is contained in:
parent
c663e8b209
commit
dfa2b446e9
1 changed files with 45 additions and 0 deletions
45
examples/systemd/sidekiq.service
Normal file
45
examples/systemd/sidekiq.service
Normal file
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# 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
|
||||
#
|
||||
# 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,
|
||||
# consider adding redis-server.service if Redis is local and systemd-managed.
|
||||
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
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/myapp/current
|
||||
ExecStart=/usr/local/bin/bundler exec sidekiq -e production
|
||||
User=deploy
|
||||
Group=deploy
|
||||
UMask=0002
|
||||
|
||||
# if we crash, restart
|
||||
RestartSec=1
|
||||
Restart=on-failure
|
||||
|
||||
# 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
|
Loading…
Add table
Reference in a new issue