Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 554540 - sys-apps/openrc-0.17: Setting rc_hotplug will enable hotplug for every service
Summary: sys-apps/openrc-0.17: Setting rc_hotplug will enable hotplug for every service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-11 19:59 UTC by Thomas Deutschmann (RETIRED)
Modified: 2015-10-21 17:53 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.