-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mqtt_input to services folder for consistency
- Loading branch information
1 parent
712be0e
commit a8cbd78
Showing
3 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,4 +65,3 @@ SyslogIdentifier=service-runner | |
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
|
|
||