From 84483e2fd3058368a139800b730f4bd62f9d33c3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 18 Jun 2021 10:13:05 -0400 Subject: [PATCH] Add a systemd service file example --- README.md | 3 +++ virtwold@.service | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 virtwold@.service diff --git a/README.md b/README.md index 1f92edf..79f9bd1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/virtwold@.service b/virtwold@.service new file mode 100644 index 0000000..827277d --- /dev/null +++ b/virtwold@.service @@ -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