linux chkconfg 报错



报错

[oracle@localhost ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 10-FEB-2017 00:07:16

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused


rhel系统

[root@localhost init.d]# uname -a
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost init.d]# cat /etc/oratab
#


# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#

# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
#orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N
orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y

启动脚本

#!/bin/bash
#
# oracle    
#
# chkconfig: 345 192 25
### BEGIN INIT INFO
# Description:       oracle auto start.
### END INIT INFO

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_OWNER=oracle

if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
    'start')
        su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" &
        su $ORACLE_OWNER -c $ORACLE_HOME/bin/dbstart &
        touch /var/lock/subsys/ora/oracle
        ;;
    'stop')
        su $ORACLE_OWNER -c $ORACLE_HOME/bin/dbshut
        su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
        rm -f /var/lock/subsys/ora/oracle
        ;;
esac

脚本单独使用都没有问题,linuxreboot就报错,查看man

For example, random.init has these three lines:
       # chkconfig: 2345 20 80
       # description: Saves and restores system entropy pool for \
       #              higher quality random number generation.
       This  says  that  the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80.  You should be
       able to figure out what the description says; the \ causes the line to be continued.  The extra space in front of the line is ignored.

第个数字是启动优先级,这个启动与其他启动冲突,最后改成最大的一个,就可以自动启动了

这里面查看使用的cat /etc/init.d/* |grep chkconfig

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值