Merge pull request #1 from simcop2387/main

Add a systemd service file example
This commit is contained in:
Scott Ellis 2021-06-18 07:54:24 -07:00 committed by GitHub
commit 7f30407401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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