add systemd service
This commit is contained in:
parent
db9c0cba32
commit
c1ef60b378
8
Makefile
8
Makefile
@ -2,10 +2,10 @@ CFLAGS = -std=gnu99 -pie -fPIC -pedantic -Wno-imports -Wunused -Wno-missing-fiel
|
|||||||
|
|
||||||
all: wireguard-mount wireguard-resolve
|
all: wireguard-mount wireguard-resolve
|
||||||
|
|
||||||
wireguard-mount: mount-daemon/wireguard-mount.c
|
wireguard-mount: src/wireguard-mount.c
|
||||||
mkdir -p bin
|
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
|
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
16
wireguard-mount.service
Normal 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
|
Loading…
Reference in New Issue
Block a user