sh if anything is wrong in boot

bridged with qdn.public.qnxrtp.os
Post Reply
Alain Bonnefoy

sh if anything is wrong in boot

Post by Alain Bonnefoy » Mon Jan 05, 2004 4:15 pm

Hi,
I have in a boot image a script which ends by:

....

sh /etc/rc.d/rc.sysinit
sh
}

I want the last sh invoked only if I cannot execute rc.sysinit succesfully.

the rc.sysinit ends by 'tinit' which runs as a background process.

What can I put at the end of rc.sysinit to not leave it?

I tried 'wait', but I get:

sh: j_init: tcgetpgrp() failed: Inappropriate I/O control operation
sh: warning: won't have full job control


Thanks,
Alain.

David Gibbs

Re: sh if anything is wrong in boot

Post by David Gibbs » Mon Jan 05, 2004 6:14 pm

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
Hi,
I have in a boot image a script which ends by:

...

sh /etc/rc.d/rc.sysinit
sh
}

I want the last sh invoked only if I cannot execute rc.sysinit succesfully.
Maybe try:

exec /etc/rc.d/rc.sysinit
sh
}
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Alain Bonnefoy

Re: sh if anything is wrong in boot

Post by Alain Bonnefoy » Tue Jan 06, 2004 1:34 pm

I didn't find how to do!

exec is not a startup-script command so I cannot 'exec
/etc/rc.d/rc.sysinit' in, and as tinit runs as a background program (I
think) 'exec tinit' in /etc/rc.d/rc.sysinit doesn't change its
behaviour, the shell script continues.

Any other idea?

I still get the following message now:

sh: j_init: tcgetpgrp() failed: Inappropriate I/O operation
sh: warning: won't have full job control

Do you know who displays that?

Alain.

David Gibbs a écrit:
Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:


Hi,
I have in a boot image a script which ends by:





...





sh /etc/rc.d/rc.sysinit
sh
}





I want the last sh invoked only if I cannot execute rc.sysinit succesfully.



Maybe try:

exec /etc/rc.d/rc.sysinit
sh
}

Peter Martin

Re: sh if anything is wrong in boot

Post by Peter Martin » Tue Jan 06, 2004 7:53 pm

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
I didn't find how to do!

exec is not a startup-script command so I cannot 'exec
/etc/rc.d/rc.sysinit' in, and as tinit runs as a background program (I
think) 'exec tinit' in /etc/rc.d/rc.sysinit doesn't change its
behaviour, the shell script continues.

Any other idea?

I still get the following message now:

sh: j_init: tcgetpgrp() failed: Inappropriate I/O operation
sh: warning: won't have full job control
This message comes from the shell (ksh)

Peter
Do you know who displays that?

Alain.

David Gibbs

Re: sh if anything is wrong in boot

Post by David Gibbs » Tue Jan 06, 2004 11:17 pm

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
I didn't find how to do!

exec is not a startup-script command so I cannot 'exec
/etc/rc.d/rc.sysinit' in,
Right, sorry -- forgot you were talking in a a boot script.

Unfortunately, the boot script doesn't have any sort of conditional
test or branch type operations in it.
and as tinit runs as a background program (I
think) 'exec tinit' in /etc/rc.d/rc.sysinit doesn't change its
behaviour, the shell script continues.
Hm...tinit probably daemonizes itself, yeah.
Any other idea?
About the only way would be to write a little C program that does
this -- that runs the startup-script, and if that fails, runs a
shell instead.
I still get the following message now:

sh: j_init: tcgetpgrp() failed: Inappropriate I/O operation
sh: warning: won't have full job control
Try

[+session] sh
Do you know who displays that?
The shell (sh) does.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs

Re: sh if anything is wrong in boot

Post by David Gibbs » Tue Jan 06, 2004 11:49 pm

David Gibbs <dagibbs@qnx.com> wrote:
Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:
I still get the following message now:

sh: j_init: tcgetpgrp() failed: Inappropriate I/O operation
sh: warning: won't have full job control

Try

[+session] sh
You might need:

reopen /dev/con1
[+session] sh

Where /dev/con1 could be /dev/ser1, or whatever your "console" for the
machine is, and assumes you've started a serial port or console driver
before you get to this point. (Or, you may already have done the reopen,
and not need it.)

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Post Reply

Return to “qdn.public.qnxrtp.os”