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

Bug 371845

Summary: sys-apps/openrc: If service is already stopped, stop exits instead of allowing more commands to be run
Product: Gentoo Hosted Projects Reporter: Christian Ruppert (idl0r) <idl0r>
Component: OpenRCAssignee: OpenRC Team <openrc>
Severity: normal CC: infra-bugs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 394205    

Description Christian Ruppert (idl0r) gentoo-dev 2011-06-15 21:19:46 UTC
In baselayout1 we could do "/etc/init.d/foobar stop zap start", in baselayout2/OpenRC that is no longer possible.
OpenRC just returns the warning that the specified service has been stopped already and doesn't continue with the "zap start".
Comment 1 William Hubbs gentoo-dev 2011-06-18 21:41:19 UTC
See the code in svc_stop_check() in src/rc/runscript.c to see why I have edited the summary.

Basically when stop is called for a service that is already stopped,  svc_stop_check exits with a successful error code instead of allowing other commands to be run.
Comment 2 Christian Ruppert (idl0r) gentoo-dev 2011-06-18 21:45:17 UTC
Yeah, that's why I said it will be a bit tricky, we'd have to change some functions, from void to int at least to allow different statuses.
Comment 3 William Hubbs gentoo-dev 2011-07-14 18:38:16 UTC
This specific case, wanting to run "stop zap start" sounds a lot like
restart. Restart currently runs "stop start", should we make it run
"stop zap start" so that you can just run restart?
Comment 4 SpanKY gentoo-dev 2011-07-14 19:08:48 UTC
i dont think we want to do that.  i dont think "stop" should abort the operation process if a service is already stopped.  if it failed to stop, then sure, but that's not the case here.
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2011-12-31 02:37:41 UTC
This has been fixed by commit 34b7632d1d2ed38c7251ac8c2869c8fc416a99f5.;a=commit;h=34b7632d