- sudo nano /lib/systemd/system/scanner.service
- Copy and Paste:
[Unit]
Description=ScannerPythonScript
After=syslog.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /fotos/listen_os.py
Restart=always
RestartSec=2
SyslogIdentifier=scannerListener
[Install]
WantedBy=multi-user.target
- Save and close the file
- sudo systemctl daemon-reload
- sudo systemctl start scanner
- sudo systemctl enable scanner
- sudo systemctl daemon-reload