diff --git a/logs/master.log b/logs/master.log new file mode 100644 index 0000000..e69de29 diff --git a/logs/master_errors.log b/logs/master_errors.log new file mode 100644 index 0000000..e69de29 diff --git a/master.py b/master.py index 22368b3..5717a44 100644 --- a/master.py +++ b/master.py @@ -1,9 +1,16 @@ ''' + __ __ _ + | \/ | __ _ ___| |_ ___ _ __ + | |\/| |/ _` / __| __/ _ \ '__| + | | | | (_| \__ \ || __/ | + |_| |_|\__,_|___/\__\___|_| + 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 --->sudo nano /etc/systemd/system/sensor_manager.service +-->sudo nano /etc/systemd/system/master_nebuleair.service +⬇️ [Unit] Description=Master manager for the Python loop scripts After=network.target @@ -13,11 +20,24 @@ ExecStart=/usr/bin/python3 /var/www/nebuleair_pro_4g/master.py Restart=always User=root WorkingDirectory=/var/www/nebuleair_pro_4g -StandardOutput=append:/var/log/master_manager.log -StandardError=append:/var/log/master_manager_error.log +StandardOutput=append:/var/www/nebuleair_pro_4g/logs/master.log +StandardError=append:/var/www/nebuleair_pro_4g/logs/master_errors.log [Install] 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