ef5941dcfcf2ec5a1a63339b58d07c068fe7218e
[distro-setup] / filesystem / etc / systemd / system / openvpn-client-nn@.service
1 [Unit]
2 Description=OpenVPN tunnel for %I
3 After=syslog.target network-online.target
4 Wants=network-online.target
5 Documentation=man:openvpn(8)
6 Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
7 Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO
8 Requires=iptables.service
9
10 [Service]
11 Type=notify
12 RuntimeDirectory=openvpn-client
13 RuntimeDirectoryMode=0710
14 WorkingDirectory=/etc/openvpn/client
15 ExecStart=/usr/bin/nsenter --mount=/root/mount_namespaces/%i /usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/%i.conf
16 # until we get the next systemd version (233), which can do bind mounts
17 # inside a mnt namespace via systemd, we have to setup our own, which requires
18 # full priveledges.
19 #CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE
20 LimitNPROC=10
21 # DeviceAllow=/dev/null rw
22 # DeviceAllow=/dev/net/tun rw
23
24 # ian: added just these lines from upstream
25 ExecStartPre=+/a/bin/newns/newns start %i
26 ExecStartPre=+/sbin/iptables-restore /a/bin/transmission-firewall/netns.rules
27 ExecStopPost=+/a/bin/newns/newns stop %i
28 PrivateNetwork=true
29
30
31 [Install]
32 WantedBy=multi-user.target