1834403 Members
2736 Online
110067 Solutions
New Discussion

error msg when rebooting

 

error msg when rebooting

When I reboot my HP-UX 11.00 machine, I see this:

# shutdown -r now

SHUTDOWN PROGRAM
10/23/01 19:08:57 EDT
Do you want to send your own message? (You must respond with 'y' or 'n'.): n

Broadcast Message from bwilliam (ttyp1) Tue Oct 23 19:09:00...
PLEASE LOG OFF NOW ! ! !
System maintenance about to begin.
All processes will be terminated in 0 seconds.


Broadcast Message from bwilliam (ttyp1) Tue Oct 23 19:09:00...
SYSTEM BEING BROUGHT DOWN NOW ! ! !


/sbin/auto_parms: DHCP access is disabled (see /etc/auto_parms.log)

/sbin/rc[38]: setenv: not found.
/sbin/rc[38]: setenv: not found.

System shutdown in progress
___________________________

Stopping OpC agent processes (opcagt). .................... OK
Stop CDE login server ..................................... OK
Stop X print server(s) .................................... N/A
Stop NFS server subsystem ................................. OK
Stopping ClearCase ........................................ OK
Shutting down CIFS Client ................................. N/A


From where might this "/sbin/rc[38]: setenv: not found." error message be coming?

7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: error msg when rebooting

Hi Brian:

Looks like you have a 'csh' (yuk!) script in your startup/shutdown sequence.

'setenv' is a 'csh' construct used to set an environment variable.

The startup/shutdown scripts in '/sbin/rc?.d/' and the configuration files in '/etc/rc.config.d/' that drive them, are expected to be POSIX scripts.

Regards!

...JRF...
harry d brown jr
Honored Contributor

Re: error msg when rebooting

Somewhere in your shutdown scripts you have a ksh script trying to execute a csh command. Could be an issue, but probably not. search your rc directories for scripts with setenv in them, and then if they do, then make sure they aren't ksh scripts.
Live Free or Die
Roger Baptiste
Honored Contributor

Re: error msg when rebooting

Brian,

line 38 of /sbin/rc refers
to /sbin/rc.utils.
/sbin/rc.utils is the script
which execures the rc scripts
in /sbin/init.d .
To find the culprit csh script
which is giving this error do

grep -l setenv /sbin/init.d/*

This should catch the script
with the setenv command.
Find out what the script is
for and if it is needed, convert it into a posix shell script.

HTH
raj
Take it easy.

Re: error msg when rebooting

Strange, I ran all these commands:

# grep -l setenv /sbin/init.d/*
# grep setenv /sbin/rc0.d/*
# grep setenv /sbin/rc1.d/*
# grep setenv /sbin/rc2.d/*
# grep setenv /sbin/rc3.d/*
# grep setenv /sbin/rc4.d/*
grep: can't open /sbin/rc4.d/*

and found no occurrence of "setenv".

The only thing I've added to this machine since it's been shipped to me is the ClearCase client and a script to start up my company's product.

# ls /sbin/rc0.d
K480syncer K888kminit K900localmount
K800killall K890kmbuild K96AVSearch

and /sbin/rc0.d/K96AVSearch is:

lrwxrwxr-x 1 root sys 21 Oct 23 19:28 K96AVSearch -> /sbin/init.d/AVSearch

and /sbin/init.d/AVSearch is this:

#!/bin/sh
#
# AVSearch This script starts and stops the AV Enterprise Search daemons.
#
# chkconfig: 345 96 96
# description: AltaVista's AV Enterprise Search product.

MODE=s ## default mode is startup

if [ $# -gt 0 ]; then
case "$1"
in
start) MODE=s;;
stop) MODE=k;;
start_msg);; #line added for HP-UX compatibility
stop_msg);; #line added for HP-UX compatibility
*) echo "$0: unknown option: $1" exit 1;;
esac
fi

( cd /usr/AVSearch/Enterprise ; ./avsetup -$MODE )

and the /usr/AVSearch/Enterprise/avsetup script is a bourne shell script, too. It has #!/bin/sh at the top of the file.


Perplexed.
Patrick Wallek
Honored Contributor

Re: error msg when rebooting

Have a look in the file /sbin/rc (yes it is there, no not the rc?.d directory) and see if there are any setenv statements in there.

I would also make sure that it is using /sbin/sh for its shell and not csh. The first line should be: #!/sbin/sh

Santosh Nair_1
Honored Contributor

Re: error msg when rebooting

How about checking in /etc/rc.config.d/. Perhaps someone threw a csh script or at least a file using csh syntax in this directory.

-Santosh
Life is what's happening while you're busy making other plans

Re: error msg when rebooting

# grep -l setenv /etc/rc.config.d/*

# ls -altr /sbin/rc
-r-xr--r-- 1 bin sys 4262 Nov 7 1997 /sbin/rc

# grep setenv /sbin/rc

# grep -l setenv /sbin/rc

(I checked, and yes, the /sbin/rc file has "#!/sbin/sh" as its first line.)

# csh

# alias findinfile 'find . -name \* -exec grep -i \!$ {} /dev/null \;'

# cd /sbin

# findinfile setenv
./ttytype:SHELLshcshtcshsetenv %s %s;
./ttytype:setenv %s %d;

# cd /etc

# findinfile setenv
./csh.login: setenv MANPATH /usr/share/man:/usr/contrib/man:/usr/local/man
./csh.login: setenv MANPATH `cat /etc/MANPATH`
./csh.login: setenv TZ `/usr/bin/sh -c '. /etc/TIMEZONE ; echo $TZ' `
# set the TZ variable
./csh.login: setenv TZ MST7MDT # change this for local time.
./csh.login: setenv TERM hp # use the default
grep: can't open ./vhelp/volumes/C/DCErncore.hv