[comp.unix.wizards] Is it me or is it my rc.local?

BHAYNES%AUDUCVAX.BITNET@cunyvm.cuny.edu (02/20/89)

PLEASE HELP!

        A few days ago we rebooted our VAX 11/750  (Ultrix V1.2)
and noticed that some of the daemons didn't start.  I can't figure
out why!!!  I tried to "sh < rc.local" in an attempt to see what
was going on and I got the following results:

        [messages deleted]

>  + echo This also is a test
>  This also is a test
>  + [ -f /etc/syslog ]
>  sh: [: not found
>  + [ -f /usr/lib/sendmail]
>  sh: [: not found

        [error messages deleted]

        The relevent section of the console log is:

>  Starting DECnet.
>  check quotas: done.

        [DECnet message deleted]

>  local daemons:.
preserving editor files
clearing /tmp
standard daemons: update cron accounting.

        [everything else is ok]

All of the files that are being looked for are there!

        Why does the if [ -f filename] work in the rc script when
the system boots, but not when I try it?  We have changed the if
statements to be if test -f ... and that works, but what bothers
me is that it used to work and all of a sudden stoped!

        part of rc.local follows:
----------------------------------------------

echo -n 'check quotas: '                                        >/dev/console
        /etc/quotacheck -a
echo 'done.'                                                    >/dev/console
/etc/quotaon -a
#if [ -f /etc/rdate ]; then
#       /etc/rdate -s                                           >/dev/console
#fi
/usr/ucb/strings /vmunix | grep 'Ultrix' >/tmp/t1
grep -v Ultrix /etc/motd >>/tmp/t1
cp /tmp/t1 /etc/motd
rm /tmp/t1
/etc/savecore /usr/adm                                          >/dev/console
echo "This is a test"
echo -n 'local daemons:'                                        >/dev/console
#if [ -f /etc/routed ]; then
#       /etc/routed & echo -n ' routed'                         >/dev/console
#fi
echo "This also is a test"
if [ -f /etc/syslog ]; then
        /etc/syslog & echo -n ' syslog'                         >/dev/console
fi
if [ -f /usr/lib/sendmail ]; then
        (cd /usr/spool/mqueue; rm -f lf*)
        /usr/lib/sendmail -bd -q1h -om& echo -n ' sendmail'     >/dev/console
fi
if [ -f /etc/lcp ]; then
        /etc/lcp -s > /dev/console 2>&1 & echo -n ' lat'        >/dev/console
fi
echo '.'                                                        >/dev/console

        Much Thanks in Advance!

        Brad Haynes


                Brad Haynes

---------------------------------------------------------------------------
Brad Haynes                        |  Internet: bhaynes@ducvax.auburn.edu
Asst. Systems Manager              |
Electrical Engineering             |  Bitnet:   BHAYNES@AUDUCVAX
321 Broun Hall                     |
Auburn University, Alabama 36849   |  Local:    b_haynes@wareagle
(205) 887-1852    (205) 826-0479   |            mv3600::b_haynes

maart@cs.vu.nl (Maarten Litmaath) (02/21/89)

BHAYNES%AUDUCVAX.BITNET@cunyvm.cuny.edu writes:
\>  sh: [: not found

There are 3 possibilities:

	1) the `[' program isn't present (in /bin);
	2) the PATH hasn't been set properly (to include /bin);
	3) it's time to recompile /bin/sh or the kernel, or to buy new hardware

I'll bet it's 1 or 2 :-)
-- 
 "Those who do not understand Henry     |Maarten Litmaath @ VU Amsterdam:
Spencer are condemned to reinvent DOS." |maart@cs.vu.nl, mcvax!botter!maart

scs@adam.pika.mit.edu (Steve Summit) (02/22/89)

In article <18409@adm.BRL.MIL> BHAYNES%AUDUCVAX.BITNET@cunyvm.cuny.edu writes:
>        Why does the if [ -f filename] work in the rc script when
>the system boots, but not when I try it?
>...what bothers me is that it used to work and all of a sudden stoped!

In article <2067@solo10.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath)
lists three good possibilities, but misses a fourth:

     4)	your system uses a multiple universe scheme, and you
	as a user are using the ATT universe while the boot
	environment (including /etc/rc) uses the UCB universe.

For those unfamiliar with it, "[" is just an extra link to
/bin/test, which merely (as I recall) causes it too look for the
matching "]".  (I suppose this is thought to make shell scripts
look nicer; I've always considered it an unnecessary hack.)

None of this explains why Brad's daemons aren't being started
under rc, which is handling "[" correctly.  The possibilities are
endless: corrupted binaries, missing configuration files,
intermittent network connections, gronked server machines
elsewhere on the network, infrequent astral conjunctions, etc.,
etc...

                                            Steve Summit
                                            scs@adam.pika.mit.edu