update
This commit is contained in:
0
logs/master.log
Normal file
0
logs/master.log
Normal file
0
logs/master_errors.log
Normal file
0
logs/master_errors.log
Normal file
26
master.py
26
master.py
@@ -1,9 +1,16 @@
|
|||||||
'''
|
'''
|
||||||
|
__ __ _
|
||||||
|
| \/ | __ _ ___| |_ ___ _ __
|
||||||
|
| |\/| |/ _` / __| __/ _ \ '__|
|
||||||
|
| | | | (_| \__ \ || __/ |
|
||||||
|
|_| |_|\__,_|___/\__\___|_|
|
||||||
|
|
||||||
Master Python script that will trigger other scripts at every chosen time pace
|
Master Python script that will trigger other scripts at every chosen time pace
|
||||||
This script is triggered as a systemd service used as an alternative to cronjobs
|
This script is triggered as a systemd service used as an alternative to cronjobs
|
||||||
|
|
||||||
-->sudo nano /etc/systemd/system/sensor_manager.service
|
-->sudo nano /etc/systemd/system/master_nebuleair.service
|
||||||
|
|
||||||
|
⬇️
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Master manager for the Python loop scripts
|
Description=Master manager for the Python loop scripts
|
||||||
After=network.target
|
After=network.target
|
||||||
@@ -13,11 +20,24 @@ ExecStart=/usr/bin/python3 /var/www/nebuleair_pro_4g/master.py
|
|||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/var/www/nebuleair_pro_4g
|
WorkingDirectory=/var/www/nebuleair_pro_4g
|
||||||
StandardOutput=append:/var/log/master_manager.log
|
StandardOutput=append:/var/www/nebuleair_pro_4g/logs/master.log
|
||||||
StandardError=append:/var/log/master_manager_error.log
|
StandardError=append:/var/www/nebuleair_pro_4g/logs/master_errors.log
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
⬆️
|
||||||
|
|
||||||
|
Reload systemd (first time after creating the service):
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
|
Enable (once), start (once and after stopping) and restart (after modification)systemd:
|
||||||
|
sudo systemctl enable master_nebuleair.service
|
||||||
|
sudo systemctl start master_nebuleair.service
|
||||||
|
sudo systemctl restart master_nebuleair.service
|
||||||
|
|
||||||
|
Check the service status:
|
||||||
|
sudo systemctl status master_nebuleair.service
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
import time
|
import time
|
||||||
|
|||||||
Reference in New Issue
Block a user