From 18a5d80801239856d94fcb4e960c68a4bff93f30 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Dec 2009 17:33:43 +0100 Subject: [PATCH] Fix broken upstream init script, drop chroot stuff from default config; add debian/prerm --- debian/anytun.default | 5 ----- debian/prerm | 12 ++++++++++++ debian/rules | 4 ++-- etc/init.d/anytun | 3 +-- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100755 debian/prerm diff --git a/debian/anytun.default b/debian/anytun.default index 7a2bce8..4457805 100644 --- a/debian/anytun.default +++ b/debian/anytun.default @@ -1,10 +1,5 @@ # Defaults for anytun initscript # sourced by /etc/init.d/anytun -# Note: chroot is tricky and not reliable yet. Use it only -# if you know what you're doing. -#CHROOTDIR='/var/run/anytun' -#DAEMONOPTS="--chroot $CHROOTDIR --username nobody" - # Additional options that are passed to the Daemon. DAEMONOPTS="--username anytun" diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 0000000..7fe2136 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,12 @@ +#!/bin/sh +# prerm script for anytun + +set -e + +if [ -x "/etc/init.d/anytun" ] && [ "$1" = remove ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d anytun stop || true + else + /etc/init.d/anytun stop || true + fi +fi diff --git a/debian/rules b/debian/rules index 06d8014..728d44d 100755 --- a/debian/rules +++ b/debian/rules @@ -61,15 +61,15 @@ binary-arch: install dh_installdocs dh_installexamples dh_installinit - # dh_installman src/man/anytun.8 dh_link dh_strip dh_compress - mkdir -p debian/anytun/usr/share/lintian/overrides/ + mkdir -p debian/anytun/usr/share/lintian/overrides/ cp -av debian/overrides debian/anytun/usr/share/lintian/overrides/anytun dh_fixperms find debian/anytun -type f -name config -exec chmod 600 {} \; find debian/anytun -type f -name post-up.sh -exec chmod 755 {} \; + chmod 600 debian/anytun/usr/share/anytun/examples/config/server/conf.d/* dh_installdeb dh_shlibdeps dh_gencontrol diff --git a/etc/init.d/anytun b/etc/init.d/anytun index 3bf1e91..6953b5d 100755 --- a/etc/init.d/anytun +++ b/etc/init.d/anytun @@ -36,8 +36,7 @@ start_vpn () { fi test -d $VARRUN_DIR || mkdir -p $VARRUN_DIR DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e '\w' | sed 's/^/--/' | tr '\n' ' '` - $DAEMON --write-pid $VARRUN_DIR/$NAME.pid $POSTUP \ - $DAEMONOPTS $DAEMONARG || STATUS="FAILED" + $DAEMON --write-pid /var/run/uanytun.$NAME.pid $POSTUP $DAEMONOPTS $DAEMONARG || STATUS="FAILED" else STATUS="no config found" fi -- 2.1.4