- 论坛徽章:
- 0
|
原帖由 blue_stone 于 2006-9-15 12:54 发表
HP-UX的默认运行级别是3, 启动过程中将运行/sbin/rc3.d下的所有脚本,不过不是以start作为参数来运行这个脚本(和linux不太一样), 如果init 2然后再init 3则会以start参数来运行所有脚本
没看明白,我这样写对不对:
守护程序,/etc/rc.config.d/Oracle:
#!/sbin/sh#
# Oracle startup/shutdown Config
# Oracle: Set to 1 Start Oracle10g
# OracleHome: home dir for Oracle
#
Oracle=1
oracleHome=/opt/oracle/bin
启动脚本,/sbin/init.d/Oracle:
#!/sbin/sh
PATH=/usr/sbin:/usr/bin:/sbin:/opt/oracle/bin
export PAHT
rval=0
case Oracle in
'start_msg')
# Emit a _short_ message relating to running this script with
# the "start" argument; this message appears as part of the checklist.
echo "Starting the Oracle 10g"
;;
'stop_msg')
# Emit a _short_ message relating to running this script with
# the "stop" argument; this message appears as part of the checklist.
echo "Stopping the Oracle 10g"
;;
'start')
# source the system configuration variables
if [ -f /etc/rc.config.d/Oracle ] ; then
. /etc/rc.config.d/Oracle
else
echo "ERROR: /etc/rc.config.d/Oracle file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$Oracle" != 1 ]; then su - oracle -c "/opt/oracle/bin/dbstart"
rval=2
else
# Execute the commands to start your subsystem
:
fi
;;
'stop')
# source the system configuration variables
if [ -f /etc/rc.config.d/Oracle ] ; then
. /etc/rc.config.d/Oracle
else
echo "ERROR: /etc/rc.config.d/Oracle file MISSING"
fi
# Check to see if this script is allowed to run...
if [ "$Oracle" != 1 ]; then su - oracle -c "/opt/oracle/bin/dbshut"
rval=2
else
:
# Execute the commands to stop your subsystem
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval
[ 本帖最后由 noise 于 2006-9-15 15:23 编辑 ] |
|