suse chkconfig命令


在opensuse上安装好mysql之后,需要调成自动开机启动模式,结果发现用chkconfig --level 35 mysqld on的时候报错,原来suse上chkconfig和红帽系列chkconfig用法有些不同。参看帮助chkconfig --help(或者man chkconfig):
usage:
        chkconfig -A|--allservices              (together with -l: show all services)
        chkconfig -t|--terse [names]            (shows the links)
        chkconfig -e|--edit  [names]            (configure services)
        chkconfig -s|--set   [name state]...    (configure services)
        chkconfig -l|--list [--deps] [names]    (shows the links)
        chkconfig -c|--check name [state]       (check state)
        chkconfig -a|--add   [names]            (runs insserv)
        chkconfig -d|--del   [names]            (runs insserv -r)
        chkconfig -h|--help                     (print usage)
        chkconfig -f|--force ...                (call insserv with -f)
        chkconfig [name]             same as chkconfig -t
        chkconfig name state...      same as chkconfig -s name state
        chkconfig --root=<root> ...  use <root> as the root file system
可以看出其中更改启动等级就已经不是--level参数了,而是-s,如要mysqld在35启动,可以chkconfig -s mysqld 35。
有几点需要说明的是:当执行chkconfig -s mysqld on启动之后,mysqld启动的默认加载的配置模式,如果默认是2345启动,那就是2345启动。默认加载可以在对应的服务名称的脚步更改,如mysqld。vi /etc/init.d/mysqld,找到
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:  2 3 4 5 (默认启动模式)
# Default-Stop: 0 1 6 (默认禁止模式)
# Short-Description: start and stop MySQL
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO
修改相应启动模式即可。
如果更改某个服务的启动模式,只需开启其需要开启的选项接口,如mysqld现在在2345模式下运作,想禁掉4模式,只需输入以下命令:
chkconfig -s mysqld 235
可能会因为某些依赖关系报错,可以使用-f强制开启。
另外的细节问题可以参看man

相关内容

    暂无相关文章