summaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2013-11-27 14:00:17 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2013-11-27 14:00:17 +0100
commit5d2a6dacba224682a940c13eb29b05d2d9d800c3 (patch)
tree4423d7e25b43dff75c7ba54a697a265f64062900 /debian/postinst
parentd8945f5aaffe81957d918f91224c90c9ae64b415 (diff)
Move pid & status files to /run/openvpn
Diffstat (limited to 'debian/postinst')
-rw-r--r--debian/postinst15
1 files changed, 12 insertions, 3 deletions
diff --git a/debian/postinst b/debian/postinst
index 22dd623..672a8d2 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -11,14 +11,23 @@ test $DEBIAN_SCRIPT_DEBUG && set -v -x
case "$1" in
configure)
- # get rid of confiles installed by mistake
- rm -f /etc/network/if-up.d/openvpn.if-up.d || true
- rm -f /etc/network/if-down.d/openvpn.if-down.d || true
db_get openvpn/create_tun || RET="false"
if [ "$RET" = "true" ]; then
[ -e /dev/net ] || mkdir -m 755 /dev/net
[ -d /dev/net -a ! -e /dev/net/tun ] && mknod /dev/net/tun c 10 200
fi
+ # move /run/openvpn.foo.pid to (subdir) /run/openvpn/foo.pid
+ if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.3.2-6 ; then
+ mkdir -p /run/openvpn
+ for f in $(ls /var/run/openvpn.*.pid /var/run/openvpn.*.status 2>/dev/null); do
+ mv "$f" "/run/openvpn/$(basename $f | sed 's/^openvpn\.//')"
+ done
+ fi
+ for f in /run/sendsigs.omit.d/openvpn.*.pid; do
+ [ -e "$f" ] && continue
+ b="$(basename $f|sed 's/openvpn\.//')"
+ ln -sf "/run/openvpn/$b" "/run/sendsigs.omit.d/openvpn.$b"
+ done
;;
esac