-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathremoteaccess.service
68 lines (54 loc) · 1.98 KB
/
remoteaccess.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 /opt/emoncms/modules/remoteaccess-client/remoteaccess.service /lib/systemd/system
# RUN AT STARTUP
# sudo systemctl daemon-reload
# sudo systemctl enable remoteaccess.service
# START / STOP With:
# sudo systemctl start remoteaccess
# sudo systemctl stop remoteaccess
# VIEW STATUS / LOG
# If Using Syslog:
# sudo systemctl status remoteaccess -n50
# where -nX is the number of log lines to view
# sudo journalctl -f -u remoteaccess
# Otherwise:
# Specify
#StandardOutput=file:/var/log/remoteaccess.log
# tail -f /var/log/remoteaccess.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 RemoteAccess script
Wants=mosquitto.service mysql.service redis.service
After=mosquitto.service mysql.service redis.service
Documentation=https://github.com/emoncms/remoteaccess-client.git
# 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/remoteaccess.log
[Service]
Type=idle
ExecStart=/usr/bin/python /opt/emoncms/modules/remoteaccess-client/client.py
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 remoteaccess -o cat
SyslogIdentifier=remoteaccess
[Install]
WantedBy=multi-user.target