Add a systemd service file example

This commit is contained in:
Your Name 2021-06-18 10:13:05 -04:00
parent dd49f4ba6c
commit 84483e2fd3
2 changed files with 26 additions and 0 deletions

View File

@ -19,3 +19,6 @@ Usage is pretty staightforward, as the command only needs one argument: the name
The daemon will keep running until killed with a SIGINT (`^c`).
Because this daemon, and wake-on-LAN, operate by MAC addresses, any VMs that are a candidate to be woken must have a hard-coded MAC in their machine configuration.
## systemd example service
There's a systemd service template example in virtwold@.service that should make it easy to configure for any interfaces that you need to run on

23
virtwold@.service Normal file
View File

@ -0,0 +1,23 @@
; An example systemd service template for virtwold
; Using a service template lets you start multiple copies
; of the daemon and control which interface it listens to
; by doing something like: systemctl enable --now virtwold@br1
; to start the daemon on the br1 network interface
;
; This will let you start multiple daemons easily on every interface
; that you need things to work with
[Unit]
Description=libvirt wake on lan daemon
After=network.target
Wants=libvirtd.service
[Service]
Type=simple
; You'll want to update the path here to where you place the final compiled binary
ExecStart=/usr/local/bin/virtwold -interface %i
Restart=on-failure
RestartSec=30s
[Install]
WantedBy=multi-user.target