From 604b2b884fb97c6b8931cdb6baa45a0a3a12909a Mon Sep 17 00:00:00 2001 From: Darik Horn Date: Mon, 21 Apr 2014 20:48:03 -0400 Subject: [PATCH] Create /etc/init/softether.conf for upstart. Create a softether.upstart file in the Debian overlay for systems that use the upstart init subsystem. This lets the operator control the SoftEther daemon with commands like: # start softether # stop softether # status softether # restart softether Also modify the softether.init file to exit early if the /etc/init/softether file is installed. Although the dh_installinit debhelper prefers an upstart configuration for automatic control, it will also install the sysv script. --- debian/softether.init | 6 ++++++ debian/softether.upstart | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 debian/softether.upstart diff --git a/debian/softether.init b/debian/softether.init index 7109595e..064d92b6 100755 --- a/debian/softether.init +++ b/debian/softether.init @@ -11,6 +11,12 @@ set -e +if test -f /etc/init/softether.conf +then + echo "SoftEther is controlled by upstart." 1>&2 + exit 0 +fi + . /etc/default/softether case $SOFTETHER_MODE in diff --git a/debian/softether.upstart b/debian/softether.upstart new file mode 100644 index 00000000..84043c2c --- /dev/null +++ b/debian/softether.upstart @@ -0,0 +1,25 @@ +description "SoftEther VPN" + +start on started networking +stop on stoppping networking + +respawn +expect stop + +script + test -f /etc/default/softether && . /etc/default/softether + case $SOFTETHER_MODE in + (vpnbridge) + exec /usr/sbin/vpnbridge upstart + ;; + (vpnclient) + exec /usr/sbin/vpnclient upstart + ;; + (vpnserver) + exec /usr/sbin/vpnserver upstart + ;; + (*) + exit 0 + ;; + esac +end script