The init script will lose control over the pid file if the internet connection goes down and the process stalls. The only way to restart the process is to manually kill the process and make sure the pid file is removed. Reproducible: Always Steps to Reproduce: 1. Disconnect the internet connection and wait for the openconnect vpn to stall and disconnect. 2. When the internet connection is brought back up, try to restart the daemon. Actual Results: /etc/init.d/openconnect.vpn0 restart * Stopping OpenConnect: vpn0 ... * start-stop-daemon: 1 process refused to stop [ !! ] * ERROR: openconnect.vpn0 failed to stop Expected Results: /etc/init.d/openconnect.vpn0 restart * Stopping OpenConnect: vpn0 ... [ ok ] * Starting OpenConnect: vpn0 ...
Created attachment 332224 [details] openconnect.init.in Added specification of pid file to the openconnect binary in addition to the start stop daemon so the process can still be restarted when the internet connection comes back up.
Comment on attachment 332224 [details] openconnect.init.in --- files/openconnect.init.in 2012-12-13 17:52:55.474864214 +0100 +++ - 2012-12-13 17:53:36.904769351 +0100 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openconnect/files/openconnect.init.in,v 1.3 2012/12/11 19:45:50 hwoarang Exp $ +# $Header: $ VPN="${RC_SVCNAME#*.}" VPNLOG="/var/log/openconnect/${VPN}" @@ -82,7 +82,7 @@ start-stop-daemon --start --make-pidfile --pidfile "${VPNPID}" --stderr "${VPNERRFILE}" --stdout "${VPNLOGFILE}" --background \ --exec /usr/sbin/openconnect \ - -- ${!VPNOPTS} ${!SERVER} <<< ${!PASSWORD} + -- --pid-file="${VPNPID}" ${!VPNOPTS} ${!SERVER} <<< ${!PASSWORD} local retval=$?
It would be preferred if the diff was attached to this bug to avoid copy/paste errors.
Created attachment 332922 [details, diff] openconnect.init.in.patch
+*openconnect-4.07-r2 (22 Dec 2012) + + 22 Dec 2012; Markos Chandras <hwoarang@gentoo.org> + +openconnect-4.07-r2.ebuild, files/openconnect.init.in: + Revbump to fix #447114 and #447106. Thanks to Matthew Schultz + <mattsch@gmail.com> +