add systemd service

This commit is contained in:
Roy Olav Purser 2021-02-24 18:33:43 +01:00
parent db9c0cba32
commit c1ef60b378
No known key found for this signature in database
GPG Key ID: 0BA77797F072BC52
5 changed files with 20 additions and 4 deletions

View File

@ -2,10 +2,10 @@ CFLAGS = -std=gnu99 -pie -fPIC -pedantic -Wno-imports -Wunused -Wno-missing-fiel
all: wireguard-mount wireguard-resolve
wireguard-mount: mount-daemon/wireguard-mount.c
wireguard-mount: src/wireguard-mount.c
mkdir -p bin
gcc $(CFLAGS) -o bin/wireguard-mount mount-daemon/wireguard-mount.c -lsystemd
gcc $(CFLAGS) -o bin/wireguard-mount src/wireguard-mount.c -lsystemd
wireguard-resolve: resolver/resolve.c resolver/resolve.s
wireguard-resolve: src/resolve.c src/resolve.s
mkdir -p bin
gcc -shared -o bin/wireguard-resolve.so -nostdlib -fPIC resolver/resolve.c resolver/resolve.s
gcc -shared -o bin/wireguard-resolve.so -nostdlib -fPIC src/resolve.c src/resolve.s

16
wireguard-mount.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=Wireguard namespace mountpoint
Requires=network.target
After=network.target
RefuseManualStop=true
[Service]
Type=notify
NotifyAccess=main
RuntimeDirectory=vpn
RuntimeDirectoryMode=0755
ExecStart=/snacks/wireguard/bin/wireguard-mount
PrivateNetwork=true
[Install]
WantedBy=multi-user.target