1833387 Members
2881 Online
110052 Solutions
New Discussion

startup programs

 
Angela Swyers_1
Frequent Advisor

startup programs

I have a script in the /sbin/rc3.d directory to shutdown and startup my oracle databases. I am getting the error in my rc.log file that the 'su' is not found. Here is the command I am running.

'start')

su - oracle -c '/wfm/dba/bin/start_system.sh'
;;

'stop')
su - oracle -c '/wfm/dba/bin/shut_system.sh'
;;

Does anyone know why I would be getting this error? Are these scripts not run as root?
6 REPLIES 6
Rick Garland
Honored Contributor

Re: startup programs

Use the path to su

/usr/bin/su -oracle -c ...

Else make a statement in the beginning that sets the PATH
Muthukumar_5
Honored Contributor

Re: startup programs

We have to use full system path on startup / shutdown scripts.

Find the full path of su as,

which su / whereis su

/usr/bin/su - oracle -c '/wfm/dba/bin/start_system.sh'

It will do it now :)

Regards
Muthu
Easy to suggest when don't know about the problem!
Dave La Mar
Honored Contributor

Re: startup programs

Angela -
Try putting in the complete path to su.
Regards,
dl

Alson attached is an HP doc oh how to set these up and test no intrusively.

"I'm not dumb. I just have a command of thoroughly useless information."
Slawomir Gora
Honored Contributor

Re: startup programs

Hi,

I' am using such script:

#!/sbin/sh
# Oracle database startup script
# ln -s /sbin/init.d/dbora /sbin/rc2.d/S999dbora
# ln -s /sbin/init.d/dbora /sbin/rc1.d/K108dbora
#
#

ORA_HOME=/u01/app/oracle/product/9.2.0
ORA_OWNER=oracle
PATH=${PATH}:/usr/bin:/usr/sbin:/sbin

if [ ! -f ${ORA_HOME}/bin/dbstart -o ! -d ${ORA_HOME} ]
then
echo "Oracle startup: cannot start"
rval=2
exit $rval
fi

rval=0

case "$1" in
start_msg)
echo "Starting up oracle database";
;;
stop_msg)
echo "Shutting down oracle database";
;;
'start')
# Start the Oracle database:
su - ${ORA_OWNER} -c ${ORA_HOME}/bin/dbstart
su - ${ORA_OWNER} -c "${ORA_HOME}/bin/lsnrctl start"
;;
'stop')
# Stop the Oracle database:
su - ${ORA_OWNER} -c "${ORA_HOME}/bin/lsnrctl stop"
su - ${ORA_OWNER} -c ${ORA_HOME}/bin/dbshut
;;
*)
echo "Usage `basename $0` start | stop !!!\n"
esac

exit $rval

# end of file
Muthukumar_5
Honored Contributor

Re: startup programs

hai gora,

IF we are using scripts on startup/shutdown we have to use full path of system commands.

In your script, echo, su ,.. are not in the full path. I hope it will not be executed.

We have to use full path as,

echo=`which echo`

$echo startup script


Else failure will be noted in rc.log file. Check it over there.



Easy to suggest when don't know about the problem!
Slawomir Gora
Honored Contributor

Re: startup programs

Hi Muthukumar

in my script PATH is set and there is no need
to use full path for commands

It works fine in a lot of my oracle installations.