Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 209258 - baselayout2 needs /var/lib/init.d
Summary: baselayout2 needs /var/lib/init.d
Status: RESOLVED CANTFIX
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Docs Team
URL: http://www.gentoo.org/doc/en/power-ma...
Whiteboard:
Keywords:
: 274587 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-07 14:57 UTC by Carron Andrea
Modified: 2009-06-18 11:13 UTC (History)
2 users (show)

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 Carron Andrea 2008-02-07 14:57:03 UTC
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
Comment 1 nm (RETIRED) gentoo-dev 2008-02-07 22:15:16 UTC
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.
Comment 2 Roy Marples 2008-02-07 23:29:21 UTC
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'
Comment 3 SpanKY gentoo-dev 2008-02-08 17:08:30 UTC
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
Comment 4 Carron Andrea 2008-02-08 18:59:25 UTC
(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.
Comment 5 nm (RETIRED) gentoo-dev 2008-02-27 00:40:18 UTC
Okay, so what's the real fix here? Mike? Roy? Anyone?
Comment 6 Roy Marples 2008-02-27 08:34:46 UTC
(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
Comment 7 SpanKY gentoo-dev 2008-02-28 18:46:57 UTC
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
Comment 8 nm (RETIRED) gentoo-dev 2008-03-20 07:04:42 UTC
(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. :)
Comment 9 nm (RETIRED) gentoo-dev 2008-04-15 06:41:19 UTC
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.
Comment 10 SpanKY gentoo-dev 2008-04-15 15:00:58 UTC
closing the bug doesnt make the issue magically disappear

the common function going into the API is "rc_runlevel"
Comment 11 Xavier Neys (RETIRED) gentoo-dev 2008-04-15 17:37:09 UTC
(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.

Comment 12 SpanKY gentoo-dev 2008-04-16 17:38:48 UTC
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
Comment 13 nm (RETIRED) gentoo-dev 2008-07-20 00:47:05 UTC
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.
Comment 14 nm (RETIRED) gentoo-dev 2009-06-18 11:13:56 UTC
*** Bug 274587 has been marked as a duplicate of this bug. ***