lilo env variables not available in rc.local

lilo env variables not available in rc.local

Post by Jado » Wed, 04 Dec 2002 03:03:29



Hi
I want to set to environment variables in lilo so that rc.local can do
stuff based on teh value of these variables, however when I do so,
these values are not available in rc.local.
lilo:
append="MYVAR=home"

rc.local
if [ "$MYVAR" = "home" ]; then
        ....set this up....
fi

Is my syntaxt wrong to access these globals vars? I read that while
the vars will not be available to the login shells, they should still
be accesssible in rc.local but no go for me.
Suggestions? (besides grepping /proc/cmdline...)

Joshua

 
 
 

lilo env variables not available in rc.local

Post by CrayzeeWul » Wed, 04 Dec 2002 07:30:38



> Hi
> I want to set to environment variables in lilo so that rc.local can do
> stuff based on teh value of these variables, however when I do so,
> these values are not available in rc.local.
> lilo:
> append="MYVAR=home"

Assuming that you have placed this at the right location in
/etc/lilo.conf, run "lilo" after editing /etc/lilo.conf, and have booted
using the corresponding kernel -- this should work.  

Quote:> rc.local
> if [ "$MYVAR" = "home" ]; then
>    ....set this up....
> fi

Is this the complete file ? Is this file exectuable ? Put the following
line at the end of the file and then check the contents of
/tmp/rc.local.env to make sure that the environment variables is set.

env > /tmp/rc.local.env

Make sure that the first line of the file is:

#! /bin/sh

What distribution are you using ?
--
CrayzeeWulf

 
 
 

lilo env variables not available in rc.local

Post by Jado » Sat, 07 Dec 2002 02:48:05


After doing the env > /tmp....  I realized that commas cannot be used
to separate append data.
From a lilo append of:
append="XMOUSE=pad,runlevel 3,reboo=bios,warm" I got an env variable
XMOUSE with a value of
"pad,runlevel 3,reboo=bios,warm". Hardly what I as looking for!  It's
odd because all the example I have seen in the docs use comma but they
do not work. After using a space to separate everything it worked
fine. So the correct syntax was:
append="XMOUSE=pad runlevel 3 reboot=bios,warm  (not sure about that
last one though. Don't know if it is one variable with 2 params or 2
different things. I have played around with it in an attempt to get my
laptop to reboot instead of just halting but it doesn't seem to
work...)

Thanks for the input!

Joshua



> > Hi
> > I want to set to environment variables in lilo so that rc.local can do
> > stuff based on teh value of these variables, however when I do so,
> > these values are not available in rc.local.
> > lilo:
> > append="MYVAR=home"

> Assuming that you have placed this at the right location in
> /etc/lilo.conf, run "lilo" after editing /etc/lilo.conf, and have booted
> using the corresponding kernel -- this should work.  

> > rc.local
> > if [ "$MYVAR" = "home" ]; then
> >       ....set this up....
> > fi

> Is this the complete file ? Is this file exectuable ? Put the following
> line at the end of the file and then check the contents of
> /tmp/rc.local.env to make sure that the environment variables is set.

> env > /tmp/rc.local.env

> Make sure that the first line of the file is:

> #! /bin/sh

> What distribution are you using ?

 
 
 

lilo env variables not available in rc.local

Post by CrayzeeWul » Sat, 07 Dec 2002 09:58:45



> After doing the env > /tmp....  I realized that commas cannot be used to
> separate append data.

Ah. Did you look at the following:

http://tldp.org/HOWTO/BootPrompt-HOWTO.html

--
CrayzeeWulf

 
 
 

1. how to pass values from lilo's menu to /etc/rc.d/rc.local

hi all,

i got a nasty little problem:

me and my users share a Linux PC. each of us wants several possible setups
at boot time, eg. german or us KBD, X11R5 or X11R6, xdm or not, start the X
server or not, and such things. a perfect solution would it be to have a
choice during bootstrap how to boot the kernel and to pass some options to
init. i know that something like 'linux VAR=VALUE'
can be typed in, and init and the rc procedures will find this VAR in its
environment. but it _IS_ too complicated to remember all possible options
and the chance for typos is high. thus i am searching for a way to put such
values into the lilo config file so that a possible boot choice would be

        'linux-with-german-keyboard-running-X11R6-under-xdm'

(of course abbreviated to g6)

any help, email prefered, welcome.
--

--

phone: +-[49]-(6162)-83754. das telefon schellt und ich bin im keller,
vielleicht nur verw"ahlt, doch ich bin schneller. ich bin der telefonmann,
ich geh immer ran. schubidu... (frei nach helge schneider)

2. Latest AFPS has problem sharing

3. which user does /etc/rc.d/rc.local / rc.sysinit run as?

4. How to test rcpbind?

5. Convert local time to gmt time without using TimeZone Env variable

6. Automating jobs on AIX

7. libc.so > 523 needed

8. 2.2.19 Debian no rc.d or rc.local ????!!!!!!

9. running apps from /etc/rc.d/rc.local

10. *BIG* Problem with /etc/rc.d/rc.local

11. starting apps from /etc/rc.d/rc.local

12. *BIG* Problem with /etc/rc.d/rc.local