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

Bug 554540

Summary: sys-apps/openrc-0.17: Setting rc_hotplug will enable hotplug for every service
Product: Gentoo Hosted Projects Reporter: Thomas Deutschmann (RETIRED) <whissi>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-11 19:59:42 UTC
Hi,

while working on bug 554510 I noticed that when you set "rc_hotplug" in "/etc/rc.conf" you have enabled hotplug for *every* service.

Reproducible: Always

Steps to Reproduce:
1. Default "/etc/rc.log" has no rc_hotplug set
2. Try `IN_HOTPLUG=1 /etc/init.d/sysctl status` which will output

    * sysctl: not allowed to be hotplugged
3. Now set 'rc_hotplug="net.wlan0"' (or to "foo" - the service don't have to exist)
4. Try `IN_HOTPLUG=1 /etc/init.d/sysctl status` again. This time the output will be

    * status: started
Actual Results:  
Enabling rc_hotplug for *any* service will enable hotplug for *every* service.

Expected Results:  
Hotplug should only be enabled for listed services.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-11 20:51:21 UTC
FYI: Mike proposed the following patch https://github.com/floppym/openrc/commit/5a2ed6874e10a8fb1b0053a683be9f2aed5284f4

I haven't checked it yet but when you re-read the comment block from rc_hotplug 

> # rc_hotplug is a list of services that we allow to be hotplugged.
> # By default we do not allow hotplugging.
> # A hotplugged service is one started by a dynamic dev manager when a matching
> # hardware device is found.
> # This service is intrinsically included in the boot runlevel.
> # To disable services, prefix with a !
> # Example - rc_hotplug="net.wlan !net.*"
> # This allows net.wlan and any service not matching net.* to be plugged.
> # Example - rc_hotplug="*"
> # This allows all services to be hotplugged

I have the feeling that the current behavior was wanted:

> # Example - rc_hotplug="net.wlan !net.*"
> # This allows net.wlan and any service not matching net.* to be plugged.
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So this looks more like a unclear documentation, I interpret 

> # rc_hotplug is a list of services that we allow to be hotplugged.

that rc_hotplug should be a whitelist (=only in rc_hotplug's value listed services are allowed to be hotplugged).

Also, the last example indicates that an explicit value is required which is wrong.

I am not convinced that people using hotplugged services really set something like 'rc_hotplug="<service-hotplug-wanted> !*"' ...
For most people this doesn't matter, until you run into a scenario like bug 554510 comment 3.
Comment 2 William Hubbs gentoo-dev 2015-10-21 17:53:23 UTC
The documentation has been clarified in commit 6cae41a.
Thanks for the report.