Skip to content

Commit

Permalink
change mqtt_input to use systemd instead of initd
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed Jan 4, 2017
1 parent 8fd1811 commit 416c8c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions emoncmsupdate
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ fi

echo

################################################################################################
if [ -f /etc/init.d/mqtt_input ]; then
echo "replacing initd mqtt_input with systemd mqtt input"
sudo /etc/init.d/mqtt_input stop
sudo rm /etc/init.d/mqtt_input
sudo cp /var/www/emoncms/scripts/mqtt_input.service /etc/systemd/system/mqtt_input.service
sudo systemctl daemon-reload
sudo systemctl enable mqtt_input.service
sudo systemctl start mqtt_input.service
fi

## Don't overwrite settings unless required (un comment if required)
# echo "Copy new default.emonpi.settings.php to settings.php & make backup old.emonpi.settings.php"
# sudo cp /var/www/emoncms/settings.php /var/www/emoncms/old.settings.php
Expand Down Expand Up @@ -192,6 +203,8 @@ if [ -f /etc/init.d/mqtt_input ]; then
sudo /etc/init.d/mqtt_input start
sleep 1
sudo /etc/init.d/mqtt_input restart
else
sudo systemctl restart mqtt_input.service
fi
echo
echo "set log rotate config owner to root"
Expand Down

0 comments on commit 416c8c6

Please sign in to comment.