Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149182 - rc restart service with different configs
Summary: rc restart service with different configs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-26 07:50 UTC by tommoyer
Modified: 2006-10-02 23:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Allow service confile profiles to restart services (rc.patch,723 bytes, patch)
2006-09-28 15:48 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tommoyer 2006-09-26 07:50:35 UTC
I have been looking at the /sbin/rc file and I noticed that if it is used to switch between softlevels and the two softlevels have a service in common it won't restart the service even if there are different config files for the different runlevels.  For example if we have two runlevels R1 and R2 and a service S that is running in both but with different configs (/etc/conf.d/S.R1 and /etc/conf.d/S.R2) and we are currently in R1 and do `rc R2`, then rc should check and see that S.R2 exists and restart the service after switching the R2.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2006-09-28 15:46:56 UTC
This is quite a trivial patch, but is a functional change, so it won't appear until baselayout-1.13.

However, a question need to be answered. Take the below scenario.

Services "foo" and "bar" are in both runlevels. Service "foo" has runlevel configs, whilst service "bar" has not. Service "bar" needs service "foo" - so for "foo" to be restarted with the new config, service "bar" needs to be stopped in the interim. Should be happen, or should we skip restarting "foo"?

Comment 2 Roy Marples (RETIRED) gentoo-dev 2006-09-28 15:48:17 UTC
Created attachment 98345 [details, diff]
Allow service confile profiles to restart services
Comment 3 tommoyer 2006-09-28 17:12:02 UTC
> 
> Services "foo" and "bar" are in both runlevels. Service "foo" has runlevel
> configs, whilst service "bar" has not. Service "bar" needs service "foo" - so
> for "foo" to be restarted with the new config, service "bar" needs to be
> stopped in the interim. Should be happen, or should we skip restarting "foo"?
> 

In the above situation, I would stop and restart both services.  This way, at the switching of the runlevel, the services are all started with the correct configurations.
Comment 4 Roy Marples (RETIRED) gentoo-dev 2006-10-02 23:35:23 UTC
This is fixed in baselayout-1.13.0_alpha1