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.
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"?
Created attachment 98345 [details, diff] Allow service confile profiles to restart services
> > 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.
This is fixed in baselayout-1.13.0_alpha1