Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Pinning runlevels to conf.d folders
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
damobrisbane
n00b
n00b


Joined: 20 Jan 2022
Posts: 9

PostPosted: Thu Jan 20, 2022 7:06 pm    Post subject: Pinning runlevels to conf.d folders Reply with quote

Hi,

Does anyone have an opinion on the idea of pinning runlevels to conf.d folders. I find having /etc/conf.d as a fixed folder name as limiting.

ie given a runlevel tree such as:

/etc/runlevels/A/10
/etc/runlevels/A/20
/etc/runlevels/A/30

/etc/runlevels/B/10
/etc/runlevels/B/20
/etc/runlevels/B/30

then

selecting runlevel A >>> /etc/conf.d/A/...

or

selecting runlevel B >>> /etc/conf.d/B/...

or the like. cheers
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2960
Location: Edge of marsh USA

PostPosted: Fri Jan 21, 2022 4:49 am    Post subject: Reply with quote

Incompatible with updates that subsequently write to /etc/conf.d/ making it high maintenance and a nuisance.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1652

PostPosted: Fri Jan 21, 2022 1:58 pm    Post subject: Reply with quote

This feels like an answer in search of a problem.

I don't see how it can benefit anyone.

If the real problem was presented, then there is probably an easier way to do whatever is necessary.
Back to top
View user's profile Send private message
damobrisbane
n00b
n00b


Joined: 20 Jan 2022
Posts: 9

PostPosted: Sat Jan 22, 2022 6:54 am    Post subject: Reply with quote

I am wanting to run up different configurations of the OS at different times. For example a basic profile or a monitoring profile. So I was thinking of a tree like runlevel configuration. A different softlevel is chosen at boot, at that will bring in a different set of configurations, like A/B configuration.
Back to top
View user's profile Send private message
C5ace
Guru
Guru


Joined: 23 Dec 2013
Posts: 472
Location: Brisbane, Australia

PostPosted: Sat Jan 22, 2022 11:26 am    Post subject: Reply with quote

I dual boot. Gentoo-1 for normal use. Gentoo-2 for experiments. Each uses different / 50GB partitions. The /home partition is the same. /var/cache/distfiles and/var/db/repos/gentoo/ are located on /home.

Disadvantage: This setup requires to run my update script twice.
_________________
Observation after 30 years working with computers:
All software has known and unknown bugs and vulnerabilities. Especially software written in complex, unstable and object oriented languages such as perl, python, C++, C#, Rust and the likes.
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 811

PostPosted: Sat Jan 22, 2022 11:47 am    Post subject: Reply with quote

I don't see a lot of use for something like this.

I have one service (cryptsetup) which i need twice with different configurations, and that was done by creating symlinks in /etc/init.d/ with different names and naming the conf.d files the same as the symlinks and adding the symlinks to the runlevels.
If one of the services you need doesn't work that way keep in mind that the files in /etc/conf.d are simply sourced by the init.d scripts so you can use all the bash features there. Nothing will stop you from reading /var/run/openrc/softlevel and set variables different depending on the value you found.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1652

PostPosted: Sat Jan 22, 2022 1:32 pm    Post subject: Reply with quote

pa4wdh wrote:
I don't see a lot of use for something like this.

I have one service (cryptsetup) which i need twice with different configurations, and that was done by creating symlinks in /etc/init.d/ with different names and naming the conf.d files the same as the symlinks and adding the symlinks to the runlevels.
If one of the services you need doesn't work that way keep in mind that the files in /etc/conf.d are simply sourced by the init.d scripts so you can use all the bash features there. Nothing will stop you from reading /var/run/openrc/softlevel and set variables different depending on the value you found.


I doubt it would be necessary to check /var/run/openrc/softlevel. OpenRC sets RC_RUNLEVEL to the current value (except reboot which is labeled shutdown here).
Back to top
View user's profile Send private message
damobrisbane
n00b
n00b


Joined: 20 Jan 2022
Posts: 9

PostPosted: Sat Jan 22, 2022 6:58 pm    Post subject: Reply with quote

Re
Code:
Incompatible with updates that subsequently write to /etc/conf.d/ making it high maintenance and a nuisance.


Im curious about this and would be surprised is this is not a challenge for others as the whole /etc/conf.d folder is overloaded. When then now have conf.d, from necessity, a mix of default and custom data. I believe the way this is handled is that if a package installer encounters an existing, custom modified config file, it wont overwrite it, but create a new ._cfg000XXXX.cfg one. In this scenario a package has no other choice because conf.d is hard coded. Im not saying necessarily a thats a bad thing, I do like the simplicity of it, but it also seems to be its own kind of nuisance, where custom and stock configurations are competing for the same real estate.
Back to top
View user's profile Send private message
Mistwolf
Apprentice
Apprentice


Joined: 07 Mar 2007
Posts: 189
Location: Edmonton, AB

PostPosted: Sat Jan 22, 2022 7:51 pm    Post subject: Reply with quote

Quote:
but create a new ._cfg000XXXX.cfg one


Which is deleted when you run etc-update/dispatch-conf.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2960
Location: Edge of marsh USA

PostPosted: Sun Jan 23, 2022 5:20 am    Post subject: Reply with quote

You should, perhaps, support your assertion that /etc/conf.d/ is overloaded. These are configurations used by the software, not all of which need user attention most of the time. If something in /etc/conf.d/ is unneeded, consider filing a bug for those packages, or volunteering assistance to developers/maintainers.

The option to do what you are suggesting does not exist unless you invent it. Dual boot, run an instance in a virtual machine, or set up a second/third/etc machine.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
damobrisbane
n00b
n00b


Joined: 20 Jan 2022
Posts: 9

PostPosted: Mon Jan 24, 2022 4:57 pm    Post subject: Reply with quote

Thank you so much for you replies. I didn't know that etc-update/dispatch-conf was even a command.

I'm going to keep plugging away at it, im happy with Gentoo/openrc. I guess one of my original motivations was around logging/monitoring with a fairly complex mix of applications. By that I mean docker/fluentd/opensearch/kafka, among others. Im often challenged by issues in the stack, for example some poor configuration (my own), is thrashing fluentd, but the interaction is with kafka. I then find myself hand-holding an app, for example updating a fluentd configuration file to switch to debug level logging and doing that similarly across applications where the problems are.

A couple of challenges in this scenario is manipulating the log level for a number of different applications at the same time. Unfortunately with some of these apps, they seem to consume quite a bit of resources, especially when running a number of them with debugging turned up and also some issue at play. Also, I am only wanting to debug for a limited amount of time. My goal really is to fix issues with as much information as I can, but once the issue is fixed, I want to go back to a lean as possible system as I can, even with logging completely turned off.

It was from this that I had a thought of having different softlevel targets, pretty much three: a failsafe level, an operational level and a debug level. I like the idea of a failsafe, a separate process is monitoring the (rc) system, and if something goes really bad, reboots on the failsafe runlevel. When I hit a problem, I run on a debug runlevel.

Cheers
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2960
Location: Edge of marsh USA

PostPosted: Mon Jan 24, 2022 5:36 pm    Post subject: Reply with quote

It sounds like you may not be aware that to change an application's configuration, i.e. log level, verbosity, etc, never requires a reboot in Linux. Ordinarily just shut down the application and restart it. On rare instances if the application is integrated with the desktop environment, log out and log back in without rebooting. Reboot to use a different kernel. That's it.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
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