Thanks for the diff. It seems that there is one part of the merge in the init script that should properly handled:
Debian changed the way openvpn daemons are started:
- # Check to see if it's already started... - if test -e /var/run/openvpn.$NAME.pid ; then - log_failure_msg "Already running (PID file exists)" - STATUS=0 - else - $DAEMON $OPTARGS --writepid /var/run/openvpn.$NAME.pid \ - $DAEMONARG $STATUSARG --cd $CONFIG_DIR \ - --config $CONFIG_DIR/$NAME.conf || STATUS=1 - fi + start-stop-daemon --start --quiet --oknodo \ + --pidfile /var/run/openvpn.$NAME.pid \ + --exec $DAEMON -- $OPTARGS --writepid /var/run/openvpn.$NAME.pid \ + $DAEMONARG $STATUSARG --cd $CONFIG_DIR \ + --config $CONFIG_DIR/$NAME.conf || STATUS=1 }
Ubuntu used to modify the way the daemon were started:
+ STATUS=0 # Check to see if it's already started... if test -e /var/run/openvpn.$NAME.pid ; then log_failure_msg "Already running (PID file exists)" - STATUS=0 else $DAEMON $OPTARGS --writepid /var/run/openvpn.$NAME.pid \ - $DAEMONARG $STATUSARG --cd $CONFIG_DIR \ - --config $CONFIG_DIR/$NAME.conf || STATUS=1 + $DAEMONARG $STATUSARG --cd $CONFIG_DIR \ + --config $CONFIG_DIR/$NAME.conf $script_security < /dev/null || STATUS=1 fi + log_end_msg $STATUS
However in the proposed merge, the old Debian behavior is restored:
- start-stop-daemon --start --quiet --oknodo \ - --pidfile /var/run/openvpn.$NAME.pid \ - --exec $DAEMON -- $OPTARGS --writepid /var/run/openvpn.$NAME.pid \ - $DAEMONARG $STATUSARG --cd $CONFIG_DIR \ - --config $CONFIG_DIR/$NAME.conf || STATUS=1 + STATUS=0 + # Check to see if it's already started... + if test -e /var/run/openvpn.$NAME.pid ; then + log_failure_msg "Already running (PID file exists)" + else + $DAEMON $OPTARGS --writepid /var/run/openvpn.$NAME.pid \ + $DAEMONARG $STATUSARG --cd $CONFIG_DIR \ + --config $CONFIG_DIR/$NAME.conf $script_security < /dev/null || STATUS=1 + fi + log_end_msg $STATUS
Could the Ubuntu changes be ported to the new way Debian uses to start daemon?
Thanks for the diff. It seems that there is one part of the merge in the init script that should properly handled:
Debian changed the way openvpn daemons are started:
- # Check to see if it's already started... openvpn. $NAME.pid ; then openvpn. $NAME.pid \ DIR/$NAME. conf || STATUS=1 openvpn. $NAME.pid \ openvpn. $NAME.pid \ DIR/$NAME. conf || STATUS=1
- if test -e /var/run/
- log_failure_msg "Already running (PID file exists)"
- STATUS=0
- else
- $DAEMON $OPTARGS --writepid /var/run/
- $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
- --config $CONFIG_
- fi
+ start-stop-daemon --start --quiet --oknodo \
+ --pidfile /var/run/
+ --exec $DAEMON -- $OPTARGS --writepid /var/run/
+ $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
+ --config $CONFIG_
}
Ubuntu used to modify the way the daemon were started:
+ STATUS=0 openvpn. $NAME.pid ; then
log_failure_ msg "Already running (PID file exists)" openvpn. $NAME.pid \ DIR/$NAME. conf || STATUS=1 DIR/$NAME. conf $script_security < /dev/null || STATUS=1
# Check to see if it's already started...
if test -e /var/run/
- STATUS=0
else
$DAEMON $OPTARGS --writepid /var/run/
- $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
- --config $CONFIG_
+ $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
+ --config $CONFIG_
fi
+ log_end_msg $STATUS
However in the proposed merge, the old Debian behavior is restored:
- start-stop-daemon --start --quiet --oknodo \ openvpn. $NAME.pid \ openvpn. $NAME.pid \ DIR/$NAME. conf || STATUS=1 openvpn. $NAME.pid ; then openvpn. $NAME.pid \ DIR/$NAME. conf $script_security < /dev/null || STATUS=1
- --pidfile /var/run/
- --exec $DAEMON -- $OPTARGS --writepid /var/run/
- $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
- --config $CONFIG_
+ STATUS=0
+ # Check to see if it's already started...
+ if test -e /var/run/
+ log_failure_msg "Already running (PID file exists)"
+ else
+ $DAEMON $OPTARGS --writepid /var/run/
+ $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
+ --config $CONFIG_
+ fi
+ log_end_msg $STATUS
Could the Ubuntu changes be ported to the new way Debian uses to start daemon?