Skip to contentSkip to conversation

Add systemd unit file for OpenVPN

PATCH In review David Sommerseth 2 participants 4 messages Sep 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add systemd unit file for OpenVPN

From: David Sommerseth <[email protected]...>

This is to encourage all Linux distributions to use a unified systemd unit file.

This unit file also tries to reduce the capabilities of the running openvpn process.

---
 distro/systemd/[email protected]... | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 distro/systemd/[email protected]...
distro/systemd/[email protected]... new file +19 -0
new file mode 100644
index 0000000..e17a8a5
@@ -0,0 +1,19 @@
+[Unit]
+Description=OpenVPN tunnel for %I
+After=syslog.target network.target
+Documentation=man:openvpn(8)
+Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
+Documentation=http://community.openvpn.net/openvpn/wiki/HOWTO
+
+[Service]
+PrivateTmp=true
+Type=forking
+PIDFile=/var/run/openvpn/%i.pid
+ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf
+CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_READ_SEARCH 
+LimitNPROC=10
+DeviceAllow=/dev/null rw
+DeviceAllow=/dev/net/tun rw
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
1.8.3.1
#1 lore raw

Hi,

Quoted 4 lines · David Sommerseth

From: David Sommerseth <[email protected]...>

This is to encourage all Linux distributions to use a unified systemd unit file.

ACK, with this small change:

distro/systemd/[email protected]... line 6

Quoted 2 lines
distro/systemd/[email protected]... new file +2 -0
+Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
+Documentation=http://community.openvpn.net/openvpn/wiki/HOWTO

Agree with yourself whether http or https is the way forward :-)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw
In reply to David Sommerseth

From: David Sommerseth <[email protected]...>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your patch has been applied to the master branch.

commit ab143f70846e381b3310ae961b970f897ec50e92

Author: David Sommerseth
Date:   Thu Sep 18 10:57:53 2014 +0200
     Add systemd unit file for OpenVPN

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: [email protected]...
     URL: http://article.gmane.org/gmane.network.openvpn.devel/9043

- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlQatWgACgkQDC186MBRfrqtqACfSQMJCILl6pO7ofEJi5n0HXap FUUAn0qvOgKqdPySq1TTL1PYFIWj73q3
=Qp8a
-----END PGP SIGNATURE-----

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So I messed it up, forgot to pull in changes Gert had done since my last pull.

The commit is the same, but the commit sha value is 8a4566ce4f01a434ac9ea841eae74330368398a0

- --
kind regards,

David Sommerseth

Quoted 11 lines · David Sommerseth

From: David Sommerseth <[email protected]...>

Your patch has been applied to the master branch.

commit ab143f70846e381b3310ae961b970f897ec50e92 Author: David
Sommerseth Date: Thu Sep 18 10:57:53 2014 +0200

Add systemd unit file for OpenVPN

Quoted 8 lines

Doering <[email protected]...> Message-Id:
[email protected]...
URL: http://article.gmane.org/gmane.network.openvpn.devel/9043

-- kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlQat1MACgkQDC186MBRfrqfQgCfauIZQy+V2N3W7GrqGNmSKgoE SoQAni9y0+40WP4GCFgi8PyXN9WmeyXC
=+DeP
-----END PGP SIGNATURE-----