Convert daemon to a system-wide systemd service

This commit is contained in:
2026-09-19 18:00:23 -05:00
parent 770e81f666
commit f6dc147778
2 changed files with 9 additions and 14 deletions
+6 -11
View File
@@ -11,7 +11,7 @@ Designed for a server kept behind glass, but works for any use where you want sy
| `asrock_hid.py` | Low level HID driver for the Polychrome controller |
| `asrock-led.py` | Manual CLI for raw read/write/commit against the device |
| `asrock-indicator.py` | Daemon with socket API plus the `ctl` client |
| `asrock-led.service` | systemd user unit for the daemon |
| `asrock-led.service` | systemd unit for the daemon (system-wide, installed to `/etc/systemd/system`) |
| `99-asrock-led.rules` | udev rule giving the `plugdev` group access to the hidraw node |
## Requirements
@@ -33,20 +33,15 @@ sudo udevadm trigger
Your user must be a member of the `plugdev` group.
2. Copy the service unit and start it:
2. Install the systemd unit and start it:
```
mkdir -p ~/.config/systemd/user
cp asrock-led.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now asrock-led.service
sudo cp asrock-led.service /etc/systemd/system/asrock-led.service
sudo systemctl daemon-reload
sudo systemctl enable --now asrock-led.service
```
Optionally enable linger so the daemon starts at boot even before login:
```
sudo loginctl enable-linger $USER
```
The daemon runs as root. If you prefer it to run unprivileged, add `User=` and `Group=` under the `[Service]` section (your user must then be in the `plugdev` group for the udev rule above to apply).
3. Put `asrock-indicator` (client shim) somewhere on your PATH, pointing at the daemon: