Comment 6 for bug 372358

Revision history for this message
Mathias Gug (mathiaz) wrote :

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?