-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpuma.service
48 lines (42 loc) · 1.46 KB
/
puma.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# /lib/systemd/system/puma.service
#
# 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=puma
# 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
Requires=puma.socket
# 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=/www/thermostat/current
Environment="RAILS_ENV=production"
ExecStart=/usr/local/bin/bundle exec pumactl --config-file /www/thermostat/current/config/puma.rb start
User=pi
Group=pi
#UMask=0002
# if we crash, restart
RestartSec=1
Restart=on-failure
StandardOutput=/www/thermostat/current/log/puma.stdout.log
StandardError=/www/thermostat/current/log/puma.stderr.log
# This will default to "bundler" if we don't specify it
SyslogIdentifier=puma
[Install]
WantedBy=multi-user.target