From 906e79b03d4462d4d3b64fa1d64cf2198726d714 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 24 Feb 2021 11:07:32 +0100 Subject: [PATCH] add sd_notify support --- Makefile | 2 +- mount-daemon/wireguard-mount.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5b60d07..15d5dd3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -std=gnu99 -pie -fPIC -pedantic -Wno-imports -Wunused -Wno-missing-field-initializers -Wextra -Wunreachable-code -O3 +CFLAGS = -std=gnu99 -pie -fPIC -pedantic -Wno-imports -Wunused -Wno-missing-field-initializers -Wextra -Wunreachable-code -lsystemd -O3 all: wireguard-mount wireguard-resolve diff --git a/mount-daemon/wireguard-mount.c b/mount-daemon/wireguard-mount.c index a82bbc7..0514565 100644 --- a/mount-daemon/wireguard-mount.c +++ b/mount-daemon/wireguard-mount.c @@ -1,6 +1,7 @@ #include #include #include +#include int main() { char mount_path[32] = {0}; @@ -11,6 +12,7 @@ int main() { perror("Error"); return 1; } + sd_notify(0, "READY=1"); while(1) { sleep(10); }