-
Notifications
You must be signed in to change notification settings - Fork 517
/
Copy pathmqtt_input.service
56 lines (44 loc) · 1.55 KB
/
mqtt_input.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
# Systemd unit file for mqtt input script
# INSTALL:
# sudo cp /var/www/emoncms/scripts/mqtt_input.service /etc/systemd/system/mqtt_input.service
# RUN AT STARTUP
# sudo systemctl daemon-reload
# sudo systemctl enable mqtt_input.service
# START / STOP With:
# sudo systemctl start mqtt_input
# sudo systemctl stop mqtt_input
# VIEW STATUS / LOG
# sudo systemctl status mqtt_input -n50
# where -nX is the number of log lines to view
# sudo journalctl -f -u mqtt_input -o cat | grep emontx
###
#
# 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 MQTT Input Script
After=mosquitto.service mysql.service redis-server.service
Documentation=https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
[Service]
Type=idle
ExecStart=/usr/bin/php /var/www/emoncms/scripts/phpmqtt_input.php
# Uncomment instead of above to use standard log file, else use systemd log
# Type=forking
# ExecStart=/bin/sh -c '/usr/bin/php /var/www/emoncms/scripts/phpmqtt_input.php 2>&1 > /var/log/mqtt_input.log &'
# Restart script if stopped
Restart=always
# Wait 60s before restart
RestartSec=60
# Tag things in the log
# View with: sudo journalctl -f -u mqtt_input -o cat
SyslogIdentifier=mqtt_input
# Un-comment to pipe log to syslog
#StandardOutput=syslog
[Install]
WantedBy=multi-user.target