System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

rc scripts not starting while server reboots

 
Sreer
Valued Contributor

rc scripts not starting while server reboots

Hi All,
iam facing an issue in my 11.11 box.

There is a script in my "/sbin/rc3.d/S97sysload

script is "S97sysload" which is not getting started while server reboots.
But am able to start manually with out any issue.

rc.log says as:

root@d850vp01:.../rc3.d # cat /etc/rc.log |grep -i sysload
usage: /sbin/init.d/sysload {start|stop}
Output from "/sbin/rc3.d/S97sysload start":
Starting Sysload sldrmd...
/local/home/sysload/coll/conf/sldrmd[9]: dirname: not found.
/local/home/sysload/coll/conf/sldrmd[35]: sed: not found.
/local/home/sysload/coll/conf/sldrmd[39]: /coll/pgm/sldrm_coll: not found.
/sbin/rc3.d/S97sysload[11]: sleep: not found.
Starting Sysload sldfsd...
/local/home/sysload/coll/conf/sldfsd[9]: dirname: not found.
/local/home/sysload/coll/conf/sldfsd[34]: sed: not found.
/local/home/sysload/coll/conf/sldfsd[43]: /coll/pgm/sldfs_rreq: not found.
root@d850vp01:.../rc3.d # uname -a
HP-UX d850vp01 B.11.11 U 9000/785 3942931648 unlimited-user license


see the starting of the script as manual:

root@d850vp01:.../rc3.d # S97sysload start
Starting Sysload sldrmd...

23282
==> Agent Sysload-Unix v5.20 (Build 55) start on Wed Mar 2 13:47:08 2011

Starting Sysload sldfsd...
root@d850vp01:.../rc3.d #
23289

==> Sysload File Server v5.20 (Build 17) start on Wed Mar 2 13:47:18 2011


root@d850vp01:.../rc3.d #
root@d850vp01:.../rc3.d # ps -ef | grep -i sysload
root 23300 5010 0 13:47:35 pts/8 0:00 grep -i sysload
root 23289 1 0 13:47:18 pts/8 0:00 /local/home/sysload/coll/pgm/sldfs_rreq start
root 23282 1 0 13:47:08 pts/8 0:00 /local/home/sysload/coll/pgm/sldrm_coll start
root 23284 23282 0 13:47:08 pts/8 0:00 sldrm_hist S35HP116 /local/home/sysload/coll/sldrmd.log 0 16300
root@d850vp01:.../rc3.d #

pls see the contents of script:

root@d850vp01:.../rc3.d # more S97sysload
#!/bin/sh
#Sysload startup script
#
SYSLOAD_CONF=/local/home/sysload/coll/conf
case ${1} in
'start')
if [ -x ${SYSLOAD_CONF}/sldrmd ]; then
echo "Starting Sysload sldrmd..."
${SYSLOAD_CONF}/sldrmd start
fi
sleep 10
if [ -x ${SYSLOAD_CONF}/sldfsd ]; then
echo "Starting Sysload sldfsd..."
${SYSLOAD_CONF}/sldfsd start
fi
;;

'stop')
if [ -x ${SYSLOAD_CONF}/sldfsd ]; then
echo "shutting down sldfsd Sysload ..."
${SYSLOAD_CONF}/sldfsd stop
fi
sleep 5
if [ -x ${SYSLOAD_CONF}/sldrmd ]; then
echo "shutting down sldrmd Sysload ..."
${SYSLOAD_CONF}/sldrmd stop
fi
sleep 10
;;
*)
echo "usage: /sbin/init.d/sysload {start|stop}"
;;
esac

S97sysload: END


Seems it bit confusing me to analyse and to get a work around to solve the issue.

Thanks in advance for your help.
Rgds
Sree
11 REPLIES
Jose Mosquera
Honored Contributor

Re: rc scripts not starting while server reboots

Hi,

Please remember use full path for commands not found. Or set a global PATH variable to search/execute these commands.

For quick localization of a command: (i.e: dirname):
#whence dirname

Rgds.
Sreer
Valued Contributor

Re: rc scripts not starting while server reboots

Hi Sorry,
Iam not sure about setting the global variable for this issue.

will it be declared in /etc/profile?

in this case how can I solve the issue?

Thanks for help.
My scripting knowledge is poor :-(

Rgds
Sree
Jose Mosquera
Honored Contributor

Re: rc scripts not starting while server reboots

Hi,

/etc/profile at booting time by rc process, Are you sure that PATH is loaded?

Rgds.
Jose Mosquera
Honored Contributor

Re: rc scripts not starting while server reboots

Hi,

Try set this in your script just for testing purposes:
PATH=`cat /etc/PATH`

Rgds
Sreer
Valued Contributor

Re: rc scripts not starting while server reboots

Hi Jose,

Thanks for your help.

The PATH variable is already setted in /etc/profile.

as you told do I need to put path info at starting of the script?

#!/bin/sh
#Sysload startup script
#
PATH=`cat /etc/PATH` ====> ???
SYSLOAD_CONF=/local/home/sysload/coll/conf
case ${1} in
'start')


pls correct me If am wrong.

many thanks
Sree
Jose Mosquera
Honored Contributor

Re: rc scripts not starting while server reboots

Hi,

Yes, set it there. Also remember export it.
Since when this happens?
Do you verified the existence of each of the executables (not found) by the command "whence"?

Rgds
Sreer
Valued Contributor

Re: rc scripts not starting while server reboots

Hi Jose again..

The issue is there till starting..after loading the sysload by other people.

The thing is if we run the script manualy its running with out any issue.

The same is not happening via server reboot !
mean via rc3.d.

this is what confusing!

many thnx for help.

rgds
Sree
Jose Mosquera
Honored Contributor

Re: rc scripts not starting while server reboots

What is the ownership (owner:group) and privileges of the script?
Jose Mosquera
Honored Contributor

Re: rc scripts not starting while server reboots

Hi again,

Have you noticed that errors comes from /local/home/sysload/coll/conf/sldrmd file?
local/home/sysload/coll/conf/sldrmd[9]: dirname: not found.
/local/home/sysload/coll/conf/sldrmd[35]: sed: not found.
/local/home/sysload/coll/conf/sldrmd[39]: /coll/pgm/sldrm_coll: not found

Just one of them comes from /sbin/rc3.d/S97sysload file:
/sbin/rc3.d/S97sysload[11]: sleep: not found.

Rgds.
Bill Hassell
Honored Contributor

Re: rc scripts not starting while server reboots

/etc/profile is not run when booting up. /etc/profile is designed for people that login. When your script is run as a start up script, you must set the PATH variable. At the beginning of your script, add this statement:

export PATH=$(cat /etc/PATH)

That will propagate the PATH variable to all the sub-processes.


Bill Hassell, sysadmin

Re: rc scripts not starting while server reboots

Also check to make sure that /usr/bin is mounted when you run your script.