Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/usr/lib/modules-load.d systemd affecting openrc
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jul 30, 2017 8:41 pm    Post subject: Reply with quote

steveL wrote:
Gentoo has never automagically enabled anything just because it is installed.
The closest parallel is with daemons; just because they're installed, does not mean the admin is ready to deal with them being started automatically, nor even wants that.

in this case, a daemon called modules-load starts automagically to load stuff from systemd locations (ref op). i can't disable that service as it's not enabled, nor listed on any runlevels.
it was a surprise to me, as it's not documented anywhere.

steveL wrote:
If a bindist wants to, that's their choice, and sod-all to do with what is best for Gentoo users.
And yes, what you're discussing here is again from the point of view of an upstream developer; and sorry, no you don't always know best: that's why we have distros.

Gentoo is not an idiot-box distribution; if an admin wants to set up autoload for their users, they can do it themselves.
The alternative breaks the principle of least-surprise, for no good reason, especially so given the context.

and that's why we have docs. those who come to gentoo do so for very specific reasons, least of all plug-and-pray!


Last edited by josephg on Tue Aug 01, 2017 1:28 am; edited 3 times in total
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Mon Jul 31, 2017 3:16 pm    Post subject: Reply with quote

josephg wrote:
Those who come to gentoo do so for very specific reasons, least of all plug-and-pray!
Heh; ++
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Aug 02, 2017 7:00 am    Post subject: Reply with quote

i just had a brainwave, and decided to test it.. all working fine and a non-destructive fix.

simple solution: disable this daemon modules-load
Code:
# chmod -x /etc/init.d/modules-load

_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
i4dnf
Apprentice
Apprentice


Joined: 18 Sep 2005
Posts: 265
Location: Bucharest, Romania

PostPosted: Wed Aug 02, 2017 7:12 am    Post subject: Reply with quote

I think that fix will be "unfixed" the next time you update openrc, especially if it contains an updated /etc/init.d/modules-load file. (I don't think the tools dealing with CONFIG_PROTECT mechanism get "activated" on file permissions only.)
Modifying the /etc/init.d/modules file and commenting out the modules-load dependecy prevents modules-load from autoloading and also, in case an update openrc contains a modified file you'll be able to inspect the changes via dispatch-conf, or whatever your prefered method.
_________________
"The only difference between me and a madman is that I am not MAD" (SALVATOR DALI)
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Aug 02, 2017 7:31 am    Post subject: Reply with quote

i4dnf wrote:
I think that fix will be "unfixed" the next time you update openrc, especially if it contains an updated /etc/init.d/modules-load file. (I don't think the tools dealing with CONFIG_PROTECT mechanism get "activated" on file permissions only.)

hmm.. and you are right! i tested this, and indeed the next emerge resets the permission bits, no relevant messages.

i4dnf wrote:
Modifying the /etc/init.d/modules file and commenting out the modules-load dependecy prevents modules-load from autoloading and also, in case an update openrc contains a modified file you'll be able to inspect the changes via dispatch-conf, or whatever your prefered method.

i'm loathe to edit /etc/init.d, and imho preferable to edit /etc/conf.d
i know i can add depends in /etc/conf.d, but can i disable/negate depends want in /etc/conf.d/modules?


Last edited by josephg on Wed Aug 02, 2017 9:54 am; edited 1 time in total
Back to top
View user's profile Send private message
i4dnf
Apprentice
Apprentice


Joined: 18 Sep 2005
Posts: 265
Location: Bucharest, Romania

PostPosted: Wed Aug 02, 2017 7:42 am    Post subject: Reply with quote

Hmm, openrc manual (man openrc-run) says the !modules-load should work.
i.e in /etc/conf.d/modules
Code:
rc_want="!modules-load"

_________________
"The only difference between me and a madman is that I am not MAD" (SALVATOR DALI)
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Aug 02, 2017 9:49 am    Post subject: Reply with quote

i couldn't find rc_want in man openrc-run, but i have tested this and it works. i think this workaround is better than the previous ones as /etc/init.d/ remains pristine.

Code:
$ cat /etc/conf.d/modules
rc_want="!modules-load"


i4dnf, thank you! this is perfect :) fits in with the gentoo policy of modifying /etc/conf.d/ rather than /etc/init.d/
also keeps this change across emerge/updates

personally i think gentoo/openrc should remove this "want modules-load" from /etc/init.d/modules, and allow user/sysadmin to add modules-load to any runlevel (just like any other service) if this is wanted. for eg
Code:
# rc-update add modules-load boot

this also means those who don't want this systemd behaviour can remove modules-load service from any runlevels.
Back to top
View user's profile Send private message
i4dnf
Apprentice
Apprentice


Joined: 18 Sep 2005
Posts: 265
Location: Bucharest, Romania

PostPosted: Wed Aug 02, 2017 7:45 pm    Post subject: Reply with quote

josephg wrote:
i couldn't find rc_want in man openrc-run, but i have tested this and it works.


man openrc-run wrote:
With the exception of /etc/rc.conf, the configuration files can also influence the dependencies of the service through variables. Simply prefix the name of the dependency with rc_.


In openrc-run speak dependencies are any of: need, use, want, after, before, provide, config, keyword
_________________
"The only difference between me and a madman is that I am not MAD" (SALVATOR DALI)
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Aug 02, 2017 11:49 pm    Post subject: Reply with quote

thanks again i4dnf

and another distro which suggests openrc has this to say about modules-load.d:
http://wiki.manjaro.org/index.php?title=using_OpenRC,_an_alternative_to_systemd#Module_auto-loading wrote:
For OpenRC, the modules to be loaded at boot are specified in /etc/conf.d/modules rather than being present as individual files in /etc/modules-load.d

The required modules can be manually moved over.

_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Mon Aug 07, 2017 8:09 am; edited 3 times in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 17915

PostPosted: Thu Aug 03, 2017 6:18 pm    Post subject: Reply with quote

Locking this thread for the time being.

As it is solved, I'll see about extracting the unrelated content later.

@steveL & mv: I've replied to the report post and separated it to its own thread. Please see that thread.

[split]steveL & mv

In the meantime, please stop engaging each other.

EDIT: Unlocked and split off some of the posts by steveL and mv.
_________________
Those who know what's best for us must rise and save us from ourselves.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Sep 26, 2018 10:34 am    Post subject: Reply with quote

reopened: latest version of openrc loads modules from systemd locations and does not respect rc_wants workaround which solved the OP issue.
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Sep 26, 2018 10:44 am    Post subject: Reply with quote

digging further… previous versions of openrc had a modules-load service to replicate systemd behaviour of automagically loading modules from systemd locations. modules-load was automatically called by modules service. the workaround blocked modules-load service.

this workaround does not work anymore, because the latest openrc removed that modules-load service and subsumed it inside the modules service. so now we can't block modules-load because it doesn't exist. do we now entirely block modules service? i feel a bit wary.
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Thu Oct 18, 2018 8:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5625
Location: Removed by Neddy

PostPosted: Thu Oct 18, 2018 7:35 pm    Post subject: Reply with quote

/etc/init.d/modules

Code:

find_modfiles()
{
   local dirs="/usr/lib/modules-load.d /run/modules-load.d /etc/modules-load.d"



1) Why the hell /usr/lib ... if an administrator now needs to disable something they need to edit part of a lib and NOT in etc (where such things are controlled from)

2) WHY THE HELL /run a tmpfs directory mounted at boot...

http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#etcHostspecificSystemConfiguration

Quote:
/etc : Host-specific system configuration
3.7.1. Purpose
The /etc hierarchy contains configuration files. A "configuration file" is a local file used to control the operation of a program; it must be static and cannot be an executable binary. [2]


Quote:

/usr/lib : Libraries for programming and packages
4.6.1. Purpose
/usr/lib includes object files and libraries. [21] On some systems, it may also include internal binaries that are not intended to be executed directly by users or shell scripts. [22]

Applications may use a single subdirectory under /usr/lib. If an application uses a subdirectory, all architecture-dependent data exclusively used by the application must be placed within that subdirectory. [23]




Fair enough storing the actual modules in /usr/lib/* but the control of this should be via /etc
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Thu Oct 18, 2018 8:34 pm    Post subject: Reply with quote

A program is not a library. /usr/bin is more appropriate than /usr/lib
Concur regarding /etc for configuration.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6281

PostPosted: Thu Oct 18, 2018 8:51 pm    Post subject: Reply with quote

Naib wrote:
if an administrator now needs to disable something they need to edit part of a lib and NOT in etc

No, it is always sufficient to edit in etc (see below).
Naib wrote:
storing the actual modules in /usr/lib/* but the control of this should be via /etc

That's how the mechanism is meant to be used: /usr/lib contains only the defaults. You can override these with /etc: If a file with the same name exists in /etc that one will be used, and the corresponding file from /usr/lib will be ignored in that case. In particular, to "remove" a file from /usr/lib you can just create an empty file (or a symlink to /dev/null) in /etc with the corresponding name.
The advantage of this is that the defaults as well as your local changes are both always accessible without using any backup or special features of a package manager. Another advantage is that in /etc really only local changes are stored which simplifies things if you want to see what you modified locally (e.g. to initialize another machine, or for backup purposes). Yet another advantage is that a package update can simply update the defaults. A disadvantage is that it is less obvious when this happens.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum