I'm using baselayout2 (from overlay openrc) on my laptop. Following the guide about Power Management (follow the URL) I found a script (/etc/acpi/actions/pgm_switch_runlevel.sh) that needs the file /var/lib/init.d/softlevel, but the folder init.d is totally missing. Reproducible: Always Actual Results: I fix it by changing /var/lib/init.d/softlevel with /lib/rc/init.d/softlevel in the script
File a feature request bug with upstream then, please. Not the GDP's problem. We don't support overlay packages in our documentation. In the meantime, I'm assigning this to Gentoo's base system maintainers so they know about it. Also CCing UberLord.
To be fair, baselayout-2.0.0_rc6 in portage also uses /lib/rc/init.d/softlevel. The only portable way of an external application (ie, not using /etc/init.d/functions.sh and bash) to workout the runlevel is like so rc-status --nocolor | sed -ne 's/^Runlevel: //p'
the docs are broken. any example code we have should never access the libdir directly. especially since baselayout allows the user to move this directory. the proper way: . /etc/init.d/functions.sh get_bootconfig echo $SOFTLEVEL
(In reply to comment #3) > the docs are broken. any example code we have should never access the libdir > directly. especially since baselayout allows the user to move this directory. > > the proper way: > . /etc/init.d/functions.sh > get_bootconfig > echo $SOFTLEVEL > I have tried it, but it said that get_bootconfig doesn't exist.
Okay, so what's the real fix here? Mike? Roy? Anyone?
(In reply to comment #5) > Okay, so what's the real fix here? Mike? Roy? Anyone? This works on all baselayouts rc-status --nocolor | sed -ne 's/^Runlevel: //p' This works on OpenRC rc-status --runlevel
ive backported the rc-status piece to baselayout-1.x we should also just automatically export SOFTLEVEL for people who source function.sh: export SOFTLEVEL=$(rc-status --level) so the compat code for external scripts (atm) becomes: if [[ -z ${SOFTLEVEL} ]] ; then type setup_defaultlevels \ && setup_defaultlevels \ || export SOFTLEVEL=$(rc-status --level) fi
(In reply to comment #7) Argh! Someone just give me a darned patch instead of confusing me & cluttering up bugzilla with random code snippets for hardmasked packages. If the document code samples should be altered *for baselayout 1* (we are *not* forking our docs and including duplicate baselayout 2 info, not 'till it's stable), then I'd appreciate a patch with the changes, or some plaintext format if you're GuideXML-impaired. Otherwise, this bug gets closed with a creative resolution. Thanks for reading this public service announcement. :)
Okay folks. I gave a month of notice and requests. Come back when you have a patch for the guide. It needs to be relevant to both baselayout-1 and baselayout-2 *at the same time*. If you're working out baselayout issues, do them in some other format, not bugzilla. Marking as LATER for the time being. Reopen if and only if you have a patch or a patchlike list of changes to make to the doc.
closing the bug doesnt make the issue magically disappear the common function going into the API is "rc_runlevel"
(In reply to comment #10) > closing the bug doesnt make the issue magically disappear Neither does reopening it. None of your suggestions work. Only roy's from comment #6 seems to yield anything useful: $ rc-status --nocolor | sed -ne 's/^Runlevel: //p' default Either fix the doc so that it works for everyone, now and later, submit a patch, or this bug gets a CANTFIX. Thanks.
yet only one of these states accurately reflects reality ... i said rc_runlevel() was the function we agreed upon for the API ... i havent released baselayout-1.x for it and patched it back yet
Marking as CANTFIX until the Gentoo maintainers/upstream come to an agreement about what to do, and/or release fixed stable versions. baselayout2/openRC aren't yet stable, so I'm not planning on putting stuff specific to them into the power management guide yet.
*** Bug 274587 has been marked as a duplicate of this bug. ***