matheusfedora
(usa Fedora)
Enviado em 05/11/2013 - 00:51h
Bom dia pessoal, estou criando um script de inicialização automatico no linux mas quando testo exibi o seguinte erro
Warning: Unit file of oracledb.service changed on disk, 'systemctl --system daemon-reload' recommended.
e não executa nenhuma das opções, nem start nem stop, e restart
valeu pessoal, aguardo resposta.
Job for oracledb.service failed. See 'systemctl status oracledb.service' and 'journalctl -n' for details.
localhost:/etc/init.d # systemctl status oracledb.service
oracledb.service
Loaded: loaded (/etc/init.d/oracledb)
Active: failed (Result: signal) since Tue, 2013-11-05 00:48:04 BRST; 35s ago
Process: 2183 ExecStart=/etc/init.d/oracledb start (code=killed, signal=SEGV)
CGroup: name=systemd:/system/oracledb.service
Nov 05 00:48:00 localhost.localdomain systemd[1]: Starting oracledb.service...
Nov 05 00:48:04 localhost.localdomain systemd[1]: Failed to start oracledb.service.
Nov 05 00:48:04 localhost.localdomain systemd[1]: Unit oracledb.service entered failed state
ps:oracledb é o nome do scritp
pessoal tá aí o script
#!/bin/sh
. /etc/init.d/oracledb
case "$1" in
start)
echo "Starting Oracle"
echo "-" >> /var/log/oracle
date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
echo - >> /var/log/oracle
echo -n "Starting Oracle Listeners:"
su oracle -c "/opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl start" >> /var/log/oracle
echo "Done."
echo -n "Starting Oracle Databases:"
su oracle -c /opt/app/oracle/product/11.2.0/db_1/bin/dbstart >> /var/log/oracle
echo "Done."
#echo -n Starting Oracle Enterprise Manager:
#su oracle -c emctl start dbconsole >> /var/log/oracle
#echo Done.
#echo
#echo - >> /var/log/oracle
#date +! %T %a %D : Finished. >> /var/log/oracle
#echo - >> /var/log/oracle
#touch /var/lock/subsys/oracle
;;
#------------------------------------------------------------------------------------------------------------------------------------------------
stop)
echo Shutting Down Oracle
echo - >> /var/log/oracle
date +! %T %a %D : Shutting Down Oracle Databases as part of system down. >> /var/log/oracle
echo - >> /var/log/oracle
#echo -n Shutting Down Oracle Enterprise Manager:
#su oracle -c emctl stop dbconsole >> /var/log/oracle
echo Done.
echo -n Shutting Down Oracle Listeners:
su oracle -c /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl stop >> /var/log/oracle
echo Done.
rm -f /var/lock/subsys/oracle
echo -n Shutting Down Oracle Databases:
su oracle -c dbshut >> /var/log/oracle
echo Done.
echo
echo - >> /var/log/oracle
date +! %T %a %D : Finished. >> /var/log/oracle
echo - >> /var/log/oracle
;;
#------------------------------------------------------------------------------------------------------------------------------------------------
restart)
echo Restarting Oracle
echo - >> /var/log/oracle
date +! %T %a %D : Restarting Oracle Databases as part of system up. >> /var/log/oracle
echo - >> /var/log/oracle
echo -n Restarting Oracle Listeners:
su oracle -c /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl stop >> /var/log/oracle
su oracle -c /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl start >> /var/log/oracle
echo Done.
echo -n Restarting Oracle Databases:
su oracle -c /opt/app/oracle/product/11.2.0/db_1/bin/dbshut >> /var/log/oracle
su oracle -c /opt/app/oracle/product/11.2.0/db_1/bin/dbstart >> /var/log/oracle
echo Done.
echo -n Restarting Oracle Enterprise Manager:
#su oracle -c emctl stop dbconsole >> /var/log/oracle
#su oracle -c emctl start dbconsole >> /var/log/oracle
#echo Done.
#echo
#echo - >> /var/log/oracle
#date +! %T %a %D : Finished. >> /var/log/oracle
#echo - >> /var/log/oracle
#touch /var/lock/subsys/oracle
;;
*)
echo $"Usage: $0 {start|stop|restar|}"
#------------------------------------------------------------------------------------------------------------------------------------------------
exit 1
esac