Skip to content

Commit

Permalink
add mqtt_input to services folder for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed Feb 6, 2019
1 parent 712be0e commit a8cbd78
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
1 change: 0 additions & 1 deletion scripts/services/feedwriter/feedwriter.service
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Systemd unit file for feedwriter script

# INSTALL:

# sudo ln -s /var/www/emoncms/scripts/services/feedwriter/feedwriter.service /lib/systemd/system

# RUN AT STARTUP
Expand Down
61 changes: 61 additions & 0 deletions scripts/services/mqtt_input/mqtt_input.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Systemd unit file for mqtt input script

# INSTALL:
# sudo ln -s /var/www/emoncms/scripts/services/mqtt_input/mqtt_input.service /lib/systemd/system

# 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
# If Using Syslog:
# sudo systemctl status mqtt_input -n50
# where -nX is the number of log lines to view
# sudo journalctl -f -u mqtt_input
# Otherwise:
# Specify
#StandardOutput=file:/var/log/mqtt_input.log
# tail -f /var/log/mqtt_input.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 mqtt_input script
Wants=mosquitto.service mysql.service redis.service
After=mosquitto.service mysql.service redis.service
Documentation=https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.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/mqtt_input.log

[Service]
Type=idle
ExecStart=/usr/bin/php /var/www/emoncms/scripts/phpmqtt_input.php

# Restart script if stopped on a failure. Will not restart if not configured correctly
Restart=on-failure
# 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 feedwriter -o cat
SyslogIdentifier=mqtt_input

[Install]
WantedBy=multi-user.target
1 change: 0 additions & 1 deletion scripts/services/service-runner/service-runner.service
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ SyslogIdentifier=service-runner

[Install]
WantedBy=multi-user.target

0 comments on commit a8cbd78

Please sign in to comment.