bk1285 / rpi_wordclock

Software to create a Raspberry Pi based wordclock
GNU General Public License v3.0
214 stars 107 forks source link

Would you like to migrate to systemd to control the wordclock as a service? #246

Open oxivanisher opened 1 year ago

oxivanisher commented 1 year ago

I could help with that, if you would like that. Here are the things that work for me so far:

/etc/systemd/system/wordclock.service

[Unit]
Description=Wordclock
After=network.target

[Service]
ExecStart=/usr/bin/env python3 /home/pi/rpi_wordclock/wordclock.py
WorkingDirectory=/home/pi/rpi_wordclock/
Restart=always
RestartSec=5
KillSignal=SIGTERM
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=wordclock
NotifyAccess=all
User=root
Group=root
Nice=1

[Install]
WantedBy=multi-user.target

Systemd Howto

IMHO (as a linux system engineer ^^) it would be nice to use a systemd unit, but I don't know if its seen as too complicated. Let me know what you think.

bk1285 commented 1 year ago

Hey @oxivanisher, I like the idea pretty much!

Feel free to start your work on latest main branch and open a PR, whenever you're done. Please ensure, that the documentation is also adopted accordingly.

... final note: Any idea how/when to register the service in /etc/systemd/system? That's probably a manual approach as part of the instructions, right?