sh if anything is wrong in boot

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.

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.

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
}

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.

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