Skip to content

Commit

Permalink
Fix start after boot: debian and other OS remove all /run directory c…
Browse files Browse the repository at this point in the history
…ontent at boot.

Create the run directory for chroot in the init script for GNU/Linux.
Add --name= in the init script.
  • Loading branch information
Laurent Coustet committed Apr 17, 2015
1 parent 3bafcda commit 04f4da2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/examples/mlvpn.init.d.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
test $DEBIAN_SCRIPT_DEBUG && set -v -x

DAEMON=@sbindir@/mlvpn
RUNDIR=@localstatedir@/run/mlvpn
USER=mlvpn
DESC="virtual private network daemon"
CONFIG_DIR=@sysconfdir@/mlvpn
test -x $DAEMON || exit 0
test -d $CONFIG_DIR || exit 0

[ -d $RUNDIR ] || mkdir $RUNDIR

# Source defaults file; edit that file to configure this script.
AUTOSTART="all"
if test -e @sysconfdir@/default/mlvpn ; then
Expand All @@ -46,7 +49,7 @@ start_vpn () {
--pidfile @localstatedir@/run/mlvpn.$NAME.pid \
--background \
--make-pidfile \
--exec $DAEMON -- -c $CONFIG_DIR/$NAME.conf --user=$USER || STATUS=1
--exec $DAEMON -- -c $CONFIG_DIR/$NAME.conf --user=$USER --name=$NAME || STATUS=1
}
stop_vpn () {
kill `cat $PIDFILE` || true
Expand Down

0 comments on commit 04f4da2

Please sign in to comment.