Fix systemd issues

parent d94d10b7
openvpn (2.3.2-9) unstable; urgency=medium
* Create /run/openvpn in init script even if no VPN is
autostarted by it. (Closes: #741938)
* Fix systemd detection based on /run/systemd/system.
-- Alberto Gonzalez Iniesta <agi@inittab.org> Mon, 17 Mar 2014 15:40:02 +0100
openvpn (2.3.2-8) unstable; urgency=medium
* Add support for systemd. (Closes: #700888)
......
......@@ -3,6 +3,7 @@
OPENVPN=/usr/sbin/openvpn
OPENVPN_INIT=/etc/init.d/openvpn
SYSTEMCTL=/bin/systemctl
SYSTEMD=/run/systemd/system
if [ ! -x $OPENVPN ]; then
exit 0
......@@ -11,7 +12,7 @@ fi
if [ -n "$IF_OPENVPN" ]; then
for vpn in $IF_OPENVPN; do
## check systemd present
if [ -x $SYSTEMCTL ]; then
if [ -d $SYSTEMD ]; then
$SYSTEMCTL stop openvpn@$vpn
else
$OPENVPN_INIT stop $vpn
......
......@@ -3,6 +3,7 @@
OPENVPN=/usr/sbin/openvpn
OPENVPN_INIT=/etc/init.d/openvpn
SYSTEMCTL=/bin/systemctl
SYSTEMD=/run/systemd/system
if [ ! -x $OPENVPN ]; then
exit 0
......@@ -11,7 +12,7 @@ fi
if [ -n "$IF_OPENVPN" ]; then
for vpn in $IF_OPENVPN; do
## check systemd present
if [ -x $SYSTEMCTL ]; then
if [ -d $SYSTEMD ]; then
$SYSTEMCTL start openvpn@$vpn
else
$OPENVPN_INIT start $vpn
......
......@@ -58,8 +58,6 @@ start_vpn () {
STATUSARG="--status /run/openvpn/$NAME.status $STATUSREFRESH"
fi
mkdir -p /run/openvpn
# tun using the "subnet" topology confuses the routing code that wrongly
# emits ICMP redirects for client to client communications
SAVED_DEFAULT_SEND_REDIRECTS=0
......@@ -110,6 +108,11 @@ case "$1" in
start)
log_daemon_msg "Starting $DESC"
# first create /run directory so it's present even
# when no VPN are autostarted by this script, but later
# by systemd openvpn@.service
mkdir -p /run/openvpn
# autostart VPNs
if test -z "$2" ; then
# check if automatic startup is disabled by AUTOSTART=none
......
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