[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: an inittab question



On Sat, Dec 30, 2006 at 10:26:36AM -0800, Junior wrote:
> Hi,
> I'm looking for an idea to use either inittab or one of the rcS scripts to start a program at bootup.
> Basically, I'm trying to bootup and before any other service or programs run, I run a script that will demand user input for an address.
> Then I will exit that program and continue normal init.

I dont know if this is enough for you, but whatever you want to do during
boot, providing you use standard init, can be done in /etc/init.d/rcS.
this is a line in my inittab:

si::sysinit:/etc/init.d/rcS

so edit this shell script, try putting read -p "enter address:" var; echo $var
wherever you like to.

> Is this something I can do with inittab as the first program called? If so, how do I wait for it to terminate before it continue? (wait on pid exit?)

you can of course run your own program from rcS. you can ask for the address
and perform your processing in separate script. it will be executed and the
script will continue asap your program ends (being it script or compiled
binary).

> Is it better to do with an rcS script?

when in rome, do like romans do. look at the rcS script. follow it to the
point where you think you found best place to put your modifications to.
I'd bet you end up making symlink in /etc/rcS.d directory after reading
README there (and docs from sysv-rc or initscripts packages).

> Have anyone done this sort of thing before?
> 
> Much thanks.
> 

-- 
matej kovac
matej.kovac@telnet.sk



Reply to: