Fix broken upstream init script, drop chroot stuff from default config; add debian...
authorMichael Prokop <mika@debian.org>
Mon, 14 Dec 2009 16:33:43 +0000 (17:33 +0100)
committerMichael Prokop <mika@debian.org>
Mon, 14 Dec 2009 16:33:43 +0000 (17:33 +0100)
debian/anytun.default
debian/prerm [new file with mode: 0755]
debian/rules
etc/init.d/anytun

index 7a2bce8..4457805 100644 (file)
@@ -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 (executable)
index 0000000..7fe2136
--- /dev/null
@@ -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
index 06d8014..728d44d 100755 (executable)
@@ -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
index 3bf1e91..6953b5d 100755 (executable)
@@ -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