ford_qc/SERVICE_SETUP.md
2025-09-03 07:03:21 -05:00

1.9 KiB

Ford QC Hotfolder Service Setup

Installation

  1. Copy the service file to systemd directory:
sudo cp ford-qc-hotfolder.service /etc/systemd/system/
  1. Reload systemd daemon:
sudo systemctl daemon-reload
  1. Enable the service to start on boot:
sudo systemctl enable ford-qc-hotfolder.service
  1. 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

  1. 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
  2. To test the script manually:

cd /home/box-cli/FORD_SCRIPTS/FORD_ASSET_PACK_QC_DEV
python3 ford_qc_box_hotfolder_process.py
  1. Check systemd service logs for errors:
sudo journalctl -u ford-qc-hotfolder.service --no-pager