Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active October 9, 2020 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/934541b2505a881e9d8588a13df6410b to your computer and use it in GitHub Desktop.
Save garystafford/934541b2505a881e9d8588a13df6410b to your computer and use it in GitHub Desktop.
[Unit]
Description=GTM Stack - Mosquitto Script
After=network.target
[Service]
ExecStart=/usr/bin/python3 -u sensor_data_to_mosquitto.py \
--host ${MOSQUITTO_HOST} --port ${MOSQUITTO_PORT} --topic ${MOSQUITTO_TOPIC}
WorkingDirectory=/home/pi/iot-analytics-at-the-edge
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment