# cp xyz /etc/init.d
# chmod 0744 /etc/init.d/xyz
# chown root:sys /etc/init.d/xyz
# cd /etc/init.d
# ln xyz /etc/rc2.d/S99xyz
# ln xyz /etc/rc0.d/K99xyz
# ls /etc/init.d/*xyz /etc/rc2.d/*xyz /etc/rc0.d/*xyz
cd /etc/init.d
-rwxr--r-- 1 root root 345 Dec 13 17:54 oraagent
-rwxr--r-- 1 root root 386 Dec 14 12:32 oratgw
# more oraagent
#!/bin/sh
user=oraagent
SU=/bin/su
AGENT_HOME=/u01/app/oraagent/product/11.1.0/agent11g
export AGENT_HOME
case "$1" in
start)
$SU - $user $AGENT_HOME/bin/emctl start agent
;;
status)
$SU - $user $AGENT_HOME/bin/emctl status agent
;;
stop)
$SU - $user $AGENT_HOME/bin/emctl stop agent
;;
*)
echo "Usage : oraagent (start|status|stop)"
;;
esac
ln -s /etc/init.d/oraagent /etc/rc0.d/K01oraagent
ln -s /etc/init.d/oraagent /etc/rc2.d/K01oraagent
ln -s /etc/init.d/oraagent /etc/rc2.d/S99oraagent
ln -s /etc/init.d/oraagent /etc/rc3.d/K01oraagent
ln -s /etc/init.d/oraagent /etc/rc3.d/S99oraagent
# more oratgw
#!/bin/sh
user=oratgw
SU=/bin/su
ORACLE_HOME=/u01/app/oratgw/product/11.2.0.3/tg_1
export ORACLE_HOME
case "$1" in
start)
$SU - $user -c "$ORACLE_HOME/bin/lsnrctl start listener1522"
;;
status)
$SU - $user -c "$ORACLE_HOME/bin/lsnrctl status listener1522"
;;
stop)
$SU - $user -c "$ORACLE_HOME/bin/lsnrctl stop listener1522"
;;
*)
echo "Usage : oraagent (start|status|stop)"
;;
esac
ln -s /etc/init.d/oratgw /etc/rc0.d/K01oratgw
ln -s /etc/init.d/oratgw /etc/rc2.d/K01oratgw
ln -s /etc/init.d/oratgw /etc/rc2.d/S99oratgw
ln -s /etc/init.d/oratgw /etc/rc3.d/K01oratgw
ln -s /etc/init.d/oratgw /etc/rc3.d/S99oratgw
Комментариев нет:
Отправить комментарий