Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101105 - /etc/init.d/functions.sh in conjunktion width RC_USE_CONFIG_PROFILE not working propably
Summary: /etc/init.d/functions.sh in conjunktion width RC_USE_CONFIG_PROFILE not worki...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-08-02 09:14 UTC by stephan wezel
Modified: 2005-10-27 17:10 UTC (History)
1 user (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 stephan wezel 2005-08-02 09:14:31 UTC
the funktion add_suffix in /etc/init.d/functions.sh does not set the right
suffix in conjunction with RC_USE_CONFIG_PROFILE.

As the description for the rc var RC_USE_CONFIG_PROFILE in /etc/conf.d/rc:

# RC_USE_CONFIG_PROFILE allows you to have different /etc/conf.d files
# based on your runlevel - if a conf.d file for your profile does not exist
# then we try and use the default one.
# To enable runlevel selection at boot, append "softlevel=foobar" to your
# kernel line to change to the foobar runlevel. Or "rc foobar" at the command
# prompt.

should it possible to change the suffix through rc <softlevel>, but it is not
because the funktion add_suffix use DEVAULTLEVEL as suffix if
RC_USE_CONFIG_PROFILE is set, which is not changed through rc <softlevel>.

I have change the function to set the right suffix depending on the current
Runlevel:

add_suffix() {
	if [ "${RC_USE_CONFIG_PROFILE}" = "yes" -a -e "$1.$mylevel" ]
	then
		echo "$1.${LEVEL}"
	else
		echo "$1"
	fi

	return 0
}


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 stephan wezel 2005-08-02 09:30:46 UTC
(In reply to comment #0)
> the funktion add_suffix in /etc/init.d/functions.sh does not set the right
> suffix in conjunction with RC_USE_CONFIG_PROFILE.
> 
> As the description for the rc var RC_USE_CONFIG_PROFILE in /etc/conf.d/rc:
> 
> # RC_USE_CONFIG_PROFILE allows you to have different /etc/conf.d files
> # based on your runlevel - if a conf.d file for your profile does not exist
> # then we try and use the default one.
> # To enable runlevel selection at boot, append "softlevel=foobar" to your
> # kernel line to change to the foobar runlevel. Or "rc foobar" at the command
> # prompt.
> 
> should it possible to change the suffix through rc <softlevel>, but it is not
> because the funktion add_suffix use DEVAULTLEVEL as suffix if
> RC_USE_CONFIG_PROFILE is set, which is not changed through rc <softlevel>.
> 
> I have change the function to set the right suffix depending on the current
> Runlevel:
> 
> add_suffix() {
> 	if [ "${RC_USE_CONFIG_PROFILE}" = "yes" -a -e "$1.$mylevel" ]
> 	then
> 		echo "$1.${LEVEL}"
> 	else
> 		echo "$1"
> 	fi
> 
> 	return 0
> }
> 
> 
> Reproducible: Always
> Steps to Reproduce:
> 1.
> 2.
> 3.

this bug belongs to baselyout-1.11.13
Comment 2 stephan wezel 2005-08-16 06:20:40 UTC
it looks like that, this belongs to all baselyoutversions 1.11.13 and greater.
Only when in new versions the DEFAULTLEVEL Shell-var will be not change through
an rc <softlevel> call.
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2005-08-25 02:45:26 UTC
You understand it incorrectly (and I gather the help is not that great).  The
RC_USE_CONFIG_PROFILE is really only enabled if you _boot_ with kernel params
'softlevel="foobar"' or whatever, and from there on it will stay like that until
reboot.  Meaning, if you boot with 'softlevel="home"', "home" will be appended
to all your config files (if they exist) until you reboot.  This is so that you
can have different profiles, say 'home' and 'work' ...

Roy, mind tweaking the help there?
Comment 4 stephan wezel 2005-08-25 12:40:00 UTC
hmm why not have it also working when someone is changing the softlevel through
rc <softlevel> ??

It makes for me more sense when it is also takes effect when changing the
softlevel through rc.

For example: You start your Laptop in softlevel nonetwork. After a while you
want to search for something in the internet. In the current behave you must
reboot with softlevel set to e.g. network or network-office to have access to
the internet/network. But if you can change it also through rc you must not
reboot your Laptop.

So you see it's a good idea to change the behave of this.
Comment 5 stephan wezel 2005-08-26 06:53:26 UTC
ups there is a bug in my modification
so here the correct one:

add_suffix() {
	if [ "${RC_USE_CONFIG_PROFILE}" = "yes" -a -e "$1.{$mylevel}" ]
	then
		echo "$1.${mylevel}"
	else
		echo "$1"
	fi

	return 0
}
Comment 6 Thomas Heinz 2005-09-26 15:34:48 UTC
I fully support the point made by Stephan Wezel. As Stephan already mentioned,
switching between different network (or more general system) profiles is vital
to a clean, dynamic laptop configuration. I am currently using Stephan's slight
modification but I have noticed that it has not yet been included into the
baselayout release.

Could you please argue why it has not been included and whether/when it will be
included in a future release?
Personally, I don't see any negative effects of the modification and I also
don't see any advantage in enforcing a reboot when switching profiles.
Comment 7 Massimo Burcheri 2005-10-22 07:05:42 UTC
I also totally agree with the comments of Wezel and Heinz. I am using this 
modification on my laptop for being able to change networks with rc <...> with 
all depending network services. And I am waiting for a corrected baselayout, so 
I don't have to change it on my own every time. 
Comment 8 Roy Marples (RETIRED) gentoo-dev 2005-10-27 09:16:38 UTC
Will be fixed in baselayout-1.12.0_pre10
Comment 9 SpanKY gentoo-dev 2005-10-27 17:10:52 UTC
thanks