add sd_notify support

This commit is contained in:
Roy Olav Purser 2021-02-24 11:07:32 +01:00
parent b8c6374f3c
commit 906e79b03d
No known key found for this signature in database
GPG Key ID: 0BA77797F072BC52
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -1,6 +1,7 @@
#include <sys/mount.h>
#include <unistd.h>
#include <stdio.h>
#include <systemd/sd-daemon.h>
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);
}