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

Re: an inittab question



>> 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).
> 

I've looked at several docs describing init scripts but I haven't found any that tells me whan to use inittab vs rc scripts.
For instance, if - like I described earier - where I want a user input (which could be a framebuffer UI program) before applications are execited, 
I would uses the following inittab (I'm using busybox):

::sysinit:/bin/my_UI_program
::sysinit:/etc/init.d/rcS
ttyAM0::askfirst:-/bin/sh
::restart:/bin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

I expect my_UI_program to start and the rcS script will not execute until my_UI_program exits, correct?
When I test this, that's exactly what I got - or it seems so anyway-, is this always the case?

Now, I have two application in my rcS script that must be respawned if killed.
If I add two respawn lines to my inittab, how does my execution sequence change. Does the first respawn line starts while the second waits for it to exit before it starts? I tried this and both programs started which means to me that my above question wity my_UI_program is not always the case.

Am I missing something here?
Is there a way to respawn an rcS script?

Thanks,
--Jr.  




Reply to: