Re: load question/dialog in %post section

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

 



On Sun, 11 May 2003, Avner BenHanoch wrote:

> thanks a lot for the detailed explanation!

;-)

The question was pretty vague.
> 
> Before I sent the question I tried something like:
>     clear
>     echo "What's your name"
>     read name
>     echo your name is $name
>     sleep 3
> 
> I put it in the %post section of my ks.cfg file.  (I used bash as the
> interpreter for the %post section.)
> 

Of course it doesn't work. Think about it!!

It asks for the user's name, it waits for the reply and then waits for a
further three seconds.


> Unfortunately my test failed.  The screen remained blue (the regular
> installation screen when in text mode).  Nothing was shown to the user.  The
> installation stopped. I tried to enter text and press return to help it
> continue, but it didn't notice me.  I had to manually reboot the system
> before the installation completed.

Ah well, then stdin & stdout are probably pointing at the wrong place.

(
Script
) >/dev/console </dev/console 2>&1




> 
> Do you think it should work and I had a mistake, or that I can't use
> interactive shell script during installation?
> If I hadn't mistake, do you think loading program that is written in one of
> the languages you mentioned (python, perl, C, Java) will succeed to interact
> with the user?

You have to divorce the sleep:
Something like this:
export PID=$$
(
sleep 30
kill -INT $PID
)&

Basically, you want the waiting process to be waiting while you're
waiting for the user. Then, when the user replies, you must kill the
waiting process before it kills you.

It's possible to do it in a shell script, but there is a race condition
in the process I outlined. Other languages do it better.

But, I'm not writing this for you. And I'm certainly _not_ testing it.





-- 
Please, reply only to the list.

Join the "Linux Support by Small Businesses" list at
http://mail.computerdatasafe.com.au/mailman/listinfo/lssb





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux