-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdemandshaper.service
67 lines (54 loc) · 1.93 KB
/
demandshaper.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Systemd unit file for mqtt input script
# ***** NOTE: RUNS AS USER "pi" BY DEFAULT *****
# If running on a non-Raspbian environment, change "User=pi" in the [Service] section
# to the user of your choice (user must exist and should be the "emoncms" admin account)
# INSTALL:
# sudo ln -s /home/pi/demandshaper/demandshaper.service /lib/systemd/system
# RUN AT STARTUP
# sudo systemctl daemon-reload
# sudo systemctl enable demandshaper.service
# START / STOP With:
# sudo systemctl start demandshaper
# sudo systemctl stop demandshaper
# VIEW STATUS / LOG
# If Using Syslog:
# sudo systemctl status demandshaper -n50
# where -nX is the number of log lines to view
# sudo journalctl -f -u demandshaper
# Otherwise:
# Specify
#StandardOutput=file:/var/log/demandshaper.log
# tail -f /var/log/demandshaper.log
###
#
# All Emoncms code is released under the GNU Affero General Public License.
# See COPYRIGHT.txt and LICENSE.txt.
#
# ---------------------------------------------------------------------
# Emoncms - open source energy visualisation
# Part of the OpenEnergyMonitor project:
# http://openenergymonitor.org
###
[Unit]
Description=Emoncms Demandshaper service
Wants=mysql.service redis.service
After=mysql.service redis.service
Documentation=https://github.com/emoncms/demandshaper/blob/master/readme.md
# Uncomment this line to use a dedicated log file for StdOut and StdErr.
# NOTE: only works in systemd v236+
# Debain "stretch" includes v232, "buster" includes v239
#StandardOutput=file:/var/log/demandshaper.log
[Service]
Type=idle
ExecStart=/usr/bin/php /home/pi/demandshaper/demandshaper_run.php
User=pi
# Restart script if stopped
Restart=always
# Wait 60s before restart
RestartSec=60
# Tag things in the log
# If you want to use the journal instead of the file above, uncomment SyslogIdentifier below
# View with: sudo journalctl -f -u demandshaper -o cat
SyslogIdentifier=demandshaper
[Install]
WantedBy=multi-user.target