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

Re: install logging



> Atually you can, you just have to be creative. See base-config for one
> creative way to do it with $SHELL.
> 
> (I filed a bug on script asking for an easier way to specify a command
> to run some time ago.)
> 

You can fool script with the $SHELL trick but you can't supply an argument
to the command being run. In this sense the .bashrc is more flexible.
I agree that a -c option for the script command would be much better.

> Yeah I've thought about doing the same for base-config. Problem is, you
> don't get additional VC's with gettys already running on them because
> init has not started the gettys when the last init script runs. 
> 

I've not explained myself. I'm not speaking of starting the install
process from the /etc/init.d scripts, which would have the inconvenient
that you described.
Instead I'm proposing of using the initscript(5) optional script which,
if present, will be  used to control the start of any process spawned by
init including the getty processes. My /etc/initscript looked like this:

    #
    # initscript	Executed by init(8) for every program it
    #		wants to spawn like this:
    #
    #		/bin/sh /etc/initscript <id> <level> <action> <process>
    #
    if [ "$1" = '1' -a -x /etc/install/install.sh ]; then
        # If spawned with id '1' and /etc/install/install.sh exists run it
        exec /etc/install/install.sh < /dev/tty$1 > /dev/tty$1 2>&1
    else
        # Anything else, execute the original program
        eval exec "$4"
    fi

The /etc/initscript normally doesn't exists. If the above initscript is
copied in /etc by the bootfloppy installer after reboot it will run the
install.sh script instead of getty, but only when handling the entry '1'
of the first VC.
If the script is deleted or renamed after the second stage of the
installation is finished a getty will be started on tty1 as usual.
While the install script is active on tty1 you still have the mgetty
on the other VC's because the iniscript will run the original process
if the init id is not '1'.

-- 
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: dz@cs.unitn.it               |
|  Via Marconi, 141                phone: ++39-0461534251              |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                             pgp: see my www home page         |
+----------------------------------------------------------------------+



Reply to: