1.9 KiB
1.9 KiB
Ford QC Hotfolder Service Setup
Installation
- Copy the service file to systemd directory:
sudo cp ford-qc-hotfolder.service /etc/systemd/system/
- Reload systemd daemon:
sudo systemctl daemon-reload
- Enable the service to start on boot:
sudo systemctl enable ford-qc-hotfolder.service
- Start the service:
sudo systemctl start ford-qc-hotfolder.service
Service Management Commands
Check service status:
sudo systemctl status ford-qc-hotfolder.service
Stop the service:
sudo systemctl stop ford-qc-hotfolder.service
Restart the service:
sudo systemctl restart ford-qc-hotfolder.service
View service logs:
sudo journalctl -u ford-qc-hotfolder.service -f
View recent logs:
sudo journalctl -u ford-qc-hotfolder.service --since "1 hour ago"
Disable service (stop auto-start on boot):
sudo systemctl disable ford-qc-hotfolder.service
Log Files
The service also writes to local log files:
- Service logs:
/home/box-cli/FORD_SCRIPTS/FORD_ASSET_PACK_QC_DEV/log/ford_qc_script.log - System logs:
journalctl -u ford-qc-hotfolder.service
Service Configuration
The service is configured to:
- Run as user
box-cli - Check for new files every 60 seconds
- Automatically restart if it crashes
- Wait 30 seconds before restarting
- Use secure systemd settings
Troubleshooting
-
If service fails to start, check:
- User permissions:
sudo chown -R box-cli:box-cli /home/box-cli/FORD_SCRIPTS/FORD_ASSET_PACK_QC_DEV - Python path and dependencies
- Box configuration file exists
- User permissions:
-
To test the script manually:
cd /home/box-cli/FORD_SCRIPTS/FORD_ASSET_PACK_QC_DEV
python3 ford_qc_box_hotfolder_process.py
- Check systemd service logs for errors:
sudo journalctl -u ford-qc-hotfolder.service --no-pager