Add systemd support

parent 1f88813d
openvpn (2.3.2-8) unstable; urgency=medium
* Add support for systemd. (Closes: #700888)
Add openvpn@.service and --enable-systemd to ./configure.
-- Alberto Gonzalez Iniesta <agi@inittab.org> Fri, 14 Mar 2014 12:59:57 +0100
openvpn (2.3.2-7) unstable; urgency=low
* Fix postinst when no *.pid files exist in /run/sendsigs.omit.d/.
......
#!/bin/sh
OPENVPN=/etc/init.d/openvpn
OPENVPN=/usr/sbin/openvpn
OPENVPN_INIT=/etc/init.d/openvpn
SYSTEMCTL=/bin/systemctl
if [ ! -x $OPENVPN ]; then
exit 0
......@@ -8,6 +10,11 @@ fi
if [ -n "$IF_OPENVPN" ]; then
for vpn in $IF_OPENVPN; do
$OPENVPN stop $vpn
## check systemd present
if [ -x $SYSTEMCTL ]; then
$SYSTEMCTL stop openvpn@$vpn
else
$OPENVPN_INIT stop $vpn
fi
done
fi
#!/bin/sh
OPENVPN=/etc/init.d/openvpn
OPENVPN=/usr/sbin/openvpn
OPENVPN_INIT=/etc/init.d/openvpn
SYSTEMCTL=/bin/systemctl
if [ ! -x $OPENVPN ]; then
exit 0
......@@ -8,6 +10,11 @@ fi
if [ -n "$IF_OPENVPN" ]; then
for vpn in $IF_OPENVPN; do
$OPENVPN start $vpn
## check systemd present
if [ -x $SYSTEMCTL ]; then
$SYSTEMCTL start openvpn@$vpn
else
$OPENVPN_INIT start $vpn
fi
done
fi
debian/openvpn@.service /lib/systemd/system
[Unit]
Description=OpenVPN connection to %i
After=network.target
[Service]
Type=forking
ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf
WorkingDirectory=/etc/openvpn
[Install]
WantedBy=multi-user.target
......@@ -14,7 +14,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
dh $@
override_dh_auto_configure:
dh_auto_configure -- $(shell dpkg-buildflags --export=configure) --enable-password-save --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --with-ifconfig-path=/sbin/ifconfig $(ROUTE_ARGS) --with-plugindir=\$${prefix}/lib/openvpn --includedir=\$${prefix}/include/openvpn --enable-pkcs11 --enable-x509-alt-username
dh_auto_configure -- $(shell dpkg-buildflags --export=configure) --enable-password-save --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --with-ifconfig-path=/sbin/ifconfig $(ROUTE_ARGS) --with-plugindir=\$${prefix}/lib/openvpn --includedir=\$${prefix}/include/openvpn --enable-pkcs11 --enable-x509-alt-username --enable-systemd
override_dh_auto_build:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment