Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 124785

Summary: Openvpn 2.0.5-r2 initscript typo in stop()
Product: Gentoo Linux Reporter: lzap <lzap>
Component: [OLD] ServerAssignee: Roy Marples (RETIRED) <uberlord>
Status: RESOLVED NEEDINFO    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description lzap 2006-03-03 05:53:13 UTC
The init script of openvpn reads:

stop() {
	ebegin "Stopping ${myservice}"
	start-stop-daemon --stop --exec /usr/sbin/openvpn --pidfile "${VPNPID}"
	eend $?
}

The start-stop-daemon command features either --exec or --pidfile. This is bad, the start-stop-daemon gives --exec more priority (http://www.koders.com/c/fid3ADAC80CB671F5EF100C7F7D63AFB1470A9C436B.aspx), so the script always tries to stop the OpenVPN using --exec method.

Every stop command should have only one type of --exec or --pidfile with combination of other parameters. OpenVPN should be stopped via --pidfile method, it should be:

	start-stop-daemon --stop --pidfile "${VPNPID}"

And here is the reason: init and start an eth up, start the openvpn, now down the eth, the openvpn process will go to stopped state. Now try to stop the openvpn with the init.d script. Youll get:

No /usr/sbin/openvpn found running; none killed.

With the pid method everything works fine. I have no clue why.

The stopping via PID is the preffered method. The solution is to change this one line.
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2006-03-03 06:10:56 UTC
> Assignee: 	secure-tunneling@gentoo.org did not match anything

Please create a proper alias.
Comment 2 Roy Marples (RETIRED) gentoo-dev 2006-04-13 11:10:27 UTC
Do you get the same error with baselayout-1.12.0_pre17-r2?
Comment 3 lzap 2006-04-13 11:14:04 UTC
Its a bug in the ebuild.
Comment 4 Roy Marples (RETIRED) gentoo-dev 2006-04-13 17:36:33 UTC
(In reply to comment #3)
> Its a bug in the ebuild.

Really? You won't know until you try baselayout-1.12.0_pre17

(hint, it may just have changed start-stop-daemon)
Comment 5 lzap 2006-04-14 03:29:35 UTC
I am sorry but this is not stable. I have 1.11.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2006-04-14 04:29:13 UTC
We're in the process of making 1.12 stable.