Not executing rc.local

Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs. The
kicker is that I can’t log in via the console or telnet to fic the problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way to
by-pass rc.local. I can’t seem to figure out how to do it from the available
Safe Mode options. Thanks,

–Todd

Todd Jochem <toddj@appliedperception.com> wrote:

Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs. The
kicker is that I can’t log in via the console or telnet to fic the problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way to
by-pass rc.local. I can’t seem to figure out how to do it from the available
Safe Mode options. Thanks,

One option, if you have a CDROM in the system, is to boot from the install
CD and pick Run From CDROM. Your disk filesystems will all show up in /fs
and you can edit/delete/move your rc.local.

chris


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

Unfortunately, this is in a remote, embedded system. :frowning:

“Chris McKillop” <cdm@qnx.com> wrote in message
news:b5vcb5$97o$1@nntp.qnx.com

Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,



One option, if you have a CDROM in the system, is to boot from the install
CD and pick Run From CDROM. Your disk filesystems will all show up in /fs
and you can edit/delete/move your rc.local.

chris


Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

Chris McKillop <cdm@qnx.com> wrote:

That is gonna be a hard one to fix. How do you interact it with it now?
Serial line over modem or?

Plus, if you have a 5 second “clean” window, maybe you can run an automated
process to “type faster” than you can… maybe something as simple
as login, “mv rc.local rc.local.bak” and then reboot. It’s a hack, but
a cool one. :slight_smile:

Cheers,
-RK

chris



Todd Jochem <> toddj@appliedperception.com> > wrote:
Unfortunately, this is in a remote, embedded system. > :frowning:

“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:b5vcb5$97o$> 1@nntp.qnx.com> …
Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,



One option, if you have a CDROM in the system, is to boot from the install
CD and pick Run From CDROM. Your disk filesystems will all show up in /fs
and you can edit/delete/move your rc.local.

chris


Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/




\

Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training, Consulting and Software Products at www.parse.com.

That is gonna be a hard one to fix. How do you interact it with it now?
Serial line over modem or?

chris


Todd Jochem <toddj@appliedperception.com> wrote:

Unfortunately, this is in a remote, embedded system. > :frowning:

“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:b5vcb5$97o$> 1@nntp.qnx.com> …
Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,



One option, if you have a CDROM in the system, is to boot from the install
CD and pick Run From CDROM. Your disk filesystems will all show up in /fs
and you can edit/delete/move your rc.local.

chris


Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

\


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

Can you drop into “debug shell” ?

If you have the access to the console, you can press “SPACE” during
boot, and enable “debug shell”. Let the boot continue untile you got
a prompt, type “exit”, you will then got a shell prompt in second time.

You now have all your binaries in place (/bin, /sbin, …), just no PATH.
You can do a “/bin/mv /etc/rc.d/rc.local /etc/rc.d/rc.local.o” to get rid
of the problem rc.local

You might want to keep a safe /.altboot if possiable.

-xtang


Todd Jochem <toddj@appliedperception.com> wrote in message
news:b5vc8v$153$1@inn.qnx.com

Unfortunately, this is in a remote, embedded system. > :frowning:

“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:b5vcb5$97o$> 1@nntp.qnx.com> …
Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine
hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a
way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,



One option, if you have a CDROM in the system, is to boot from the
install
CD and pick Run From CDROM. Your disk filesystems will all show up in
/fs
and you can edit/delete/move your rc.local.

chris


Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I
get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/
\

Todd has also given me permission to reproduce the following private e-mail
which started before I became aware of this newsgroup thread (thanks,
Todd!):

David,
Thanks for the pointer about the SAFEMODE variable - I’ve already
incorporated that into the next version of rc.local so this doesn’t
happen again. I think we’ve got a solution to our problem by
artificially making the program loop before it gets to the part that
cause it to hang. Anyway, thanks for all your help!

–Todd

-----Original Message-----
From: David Bacon [mailto:dbacon@qnx.com]
Sent: Thursday, March 27, 2003 12:42 PM
To: ‘toddj@appliedperception.com
Subject: RE: Rc.local


If you’re looking for a general solution, I note that in
/etc/rc.d/rc.sysinit, there is one place where there is a test for the
environment variable SAFEMODE being set. You could use that same
variable to decide whether or not to look for rc.local (I mean modify
rc.sysinit to do that). Alternatively, you could just have your
rc.local immediately exit whenever it saw `! -z “$SAFEMODE”’.

Is booting from floppy also an option, by the way?

dB

Xiaodan Tang <xtang@qnx.com> wrote in message
news:b5veg2$aqg$1@nntp.qnx.com

Can you drop into “debug shell” ?

If you have the access to the console, you can press “SPACE” during
boot, and enable “debug shell”. Let the boot continue untile you got
a prompt, type “exit”, you will then got a shell prompt in second time.

You now have all your binaries in place (/bin, /sbin, …), just no PATH.
You can do a “/bin/mv /etc/rc.d/rc.local /etc/rc.d/rc.local.o” to get rid
of the problem rc.local

You might want to keep a safe /.altboot if possiable.

-xtang


Todd Jochem <> toddj@appliedperception.com> > wrote in message
news:b5vc8v$153$> 1@inn.qnx.com> …
Unfortunately, this is in a remote, embedded system. > :frowning:

“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:b5vcb5$97o$> 1@nntp.qnx.com> …
Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine
hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a
way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,



One option, if you have a CDROM in the system, is to boot from the
install
CD and pick Run From CDROM. Your disk filesystems will all show up in
/fs
and you can edit/delete/move your rc.local.

chris


Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I
get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/


\

Todd Jochem <toddj@appliedperception.com> wrote:

Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs. The
kicker is that I can’t log in via the console or telnet to fic the problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way to
by-pass rc.local. I can’t seem to figure out how to do it from the available
Safe Mode options. Thanks,

The decision as to whether or not to run the rc.local is done in the
rc.sysinit – it does a “test -x /etc/rc.d/rc.local” – if you can knock
down the execute bit, it won’t be run. (Which means you don’t need
to edit the file, you just need to get a “chmod -x /etc/rc.d/rc.local”
executed. Can you type that fast enough?

Can you cut+paste that fast enough if telneting in?

For the safe mode choices – try the “F5 Start a debug shell after
mounting filesystems”.

This will give you a shell before the rc.local has been run. But,
at this point your executables won’t yet be in /bin or /usr/bin or
anything like that either – so you will have to run the chmod executable
from its “real” location.

This will run a “fesh” – you can check the docs, but you have access to
built-in versions of a few useful command line utilities at this point –
including “els”, “ecp”, and “erm”. The normal shell built-in “cd” also
works fine.

Try:

cd /etc/rc.d
els
ecp rc.local rc.local.bak
erm rc.local

And then exit to continue your boot.

-David

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

David Bacon <dbacon@qnx.com> wrote:

Todd has also given me permission to reproduce the following private e-mail
which started before I became aware of this newsgroup thread (thanks,
Todd!):

David,
Thanks for the pointer about the SAFEMODE variable - I’ve already
incorporated that into the next version of rc.local so this doesn’t
happen again. I think we’ve got a solution to our problem by
artificially making the program loop before it gets to the part that
cause it to hang. Anyway, thanks for all your help!

–Todd

-----Original Message-----
From: David Bacon [mailto:> dbacon@qnx.com> ]
Sent: Thursday, March 27, 2003 12:42 PM
To: ‘> toddj@appliedperception.com> ’
Subject: RE: Rc.local



If you’re looking for a general solution, I note that in
/etc/rc.d/rc.sysinit, there is one place where there is a test for the
environment variable SAFEMODE being set. You could use that same
variable to decide whether or not to look for rc.local (I mean modify
rc.sysinit to do that). Alternatively, you could just have your
rc.local immediately exit whenever it saw `! -z “$SAFEMODE”’.

Is booting from floppy also an option, by the way?

dB

Can you put a shell prompt in rc.local? I never tried it.
I would do that before I just completely skipped it.
You don’t necessarily know why your in SAFEMODE.

Thanks for all the suggestions. As David B. mentioned, we got things worked
out. I did try the debug shell option, but any command I typed in the shell
came back with something like “command not found” error message. It didn’t
seem like there was any filesystem at all. Anyway, I’m saving these ideas
for the next time this happens. :slight_smile:

–Todd


“David Gibbs” <dagibbs@qnx.com> wrote in message
news:b5vrd9$idb$1@nntp.qnx.com

Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,

The decision as to whether or not to run the rc.local is done in the
rc.sysinit – it does a “test -x /etc/rc.d/rc.local” – if you can knock
down the execute bit, it won’t be run. (Which means you don’t need
to edit the file, you just need to get a “chmod -x /etc/rc.d/rc.local”
executed. Can you type that fast enough?

Can you cut+paste that fast enough if telneting in?

For the safe mode choices – try the “F5 Start a debug shell after
mounting filesystems”.

This will give you a shell before the rc.local has been run. But,
at this point your executables won’t yet be in /bin or /usr/bin or
anything like that either – so you will have to run the chmod executable
from its “real” location.

This will run a “fesh” – you can check the docs, but you have access to
built-in versions of a few useful command line utilities at this point –
including “els”, “ecp”, and “erm”. The normal shell built-in “cd” also
works fine.

Try:

cd /etc/rc.d
els
ecp rc.local rc.local.bak
erm rc.local

And then exit to continue your boot.

-David

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

Todd Jochem <toddj@assistware.com> wrote:

Thanks for all the suggestions. As David B. mentioned, we got things worked
out. I did try the debug shell option, but any command I typed in the shell
came back with something like “command not found” error message. It didn’t
seem like there was any filesystem at all.

There is a filesystem – but the package filesystem hasn’t run to put
things in their normal place – so they all still live under some
/packages tree. I’ve done enough tech support to get used to navigating
in that environment with things like “print *” to list the contents of
a directory. And, in fact, you are given fesh, which has built-in
replacements for a number of the commonly-used utilities (as I pointed out).

Anyway, I’m saving these ideas
for the next time this happens. > :slight_smile:

-David

–Todd



“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:b5vrd9$idb$> 1@nntp.qnx.com> …
Todd Jochem <> toddj@appliedperception.com> > wrote:
Hi all,
I’m in a jam - I’ve got a program that is started from rc.local.
Unfortunately, I broke that program and as a result, the machine hangs.
The
kicker is that I can’t log in via the console or telnet to fic the
problem -
I’ve got about 5 seconds and I can’t type that fast! So, is there a way
to
by-pass rc.local. I can’t seem to figure out how to do it from the
available
Safe Mode options. Thanks,

The decision as to whether or not to run the rc.local is done in the
rc.sysinit – it does a “test -x /etc/rc.d/rc.local” – if you can knock
down the execute bit, it won’t be run. (Which means you don’t need
to edit the file, you just need to get a “chmod -x /etc/rc.d/rc.local”
executed. Can you type that fast enough?

Can you cut+paste that fast enough if telneting in?

For the safe mode choices – try the “F5 Start a debug shell after
mounting filesystems”.

This will give you a shell before the rc.local has been run. But,
at this point your executables won’t yet be in /bin or /usr/bin or
anything like that either – so you will have to run the chmod executable
from its “real” location.

This will run a “fesh” – you can check the docs, but you have access to
built-in versions of a few useful command line utilities at this point –
including “els”, “ecp”, and “erm”. The normal shell built-in “cd” also
works fine.

Try:

cd /etc/rc.d
els
ecp rc.local rc.local.bak
erm rc.local

And then exit to continue your boot.

-David

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


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