I have a service on my Raspberry Pi which runs a bash file on boot. I recently updated the bash file (run.sh
) but the service is not reflecting the update.
So far I have tried:
sudo systemctl disable/enable garden-zero.service
sudo systemtl stop/start garden-zero.service
sudo systemctl daemon-reload
Nothing has worked. The service is still not running the environment.py script I added.
Bash File (run.sh)
#!/bin/sh
# Sensors
/home/pi/apps/garden-zero/sensors/environment.py &
/home/pi/apps/garden-zero/sensors/soil-temperature.py &
/home/pi/apps/garden-zero/sensors/soil-moisture.py &
# Metrics
/home/pi/apps/garden-zero/metrics/heartbeat.py &
Service Config
[Unit]
Description=Garden Zero
After=network-online.target
[Service]
Type=forking
ExecStart=run.sh
WorkingDirectory=/home/pi/apps/garden-zero
StandardOutput=inherit
StandardError=inherit
Restart=always
User=gardenAdmin
[Install]
WantedBy=multi-user.target
Output when status is run
garden-zero.service - Garden Zero
Loaded: loaded (/etc/systemd/system/garden-zero.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-06-03 02:40:11 BST; 1h 23min ago
Tasks: 7 (limit: 725)
CGroup: /system.slice/garden-zero.service
├─406 python3 /home/pi/apps/garden-zero/sensors/soil-temperature.py
├─407 python3 /home/pi/apps/garden-zero/sensors/soil-moisture.py
└─408 python3 /home/pi/apps/garden-zero/metrics/heartbeat.py
Jun 03 02:40:11 raspberrypi systemd[1]: Starting Garden Zero...
Jun 03 02:40:11 raspberrypi systemd[1]: Started Garden Zero.
I would expect to see /home/pi/apps/garden-zero/sensors/environment.py listed but its not