chkconfig 和 service区别

 环境:以下命令仅适于redhat/centos,不适合于ubuntu.

先说共性吧

chkconfig和service都可以作为服务启动,比如:

service postgresql start

或者

/etc/init.d/postgresql start

再说区别

chkconfig除了可以启动服务外,还可以把服务添加到启动列表中。

所以可以狭窄的理解为:

service启动的服务在机器重启后将会失效。

而chkconfig添加的服务在机器重启后依然生效。

http://zhidao.baidu.com/link?url=jkQbO776pg6sqpeUWQZODYds1NtnFWQC5S8-hW_BbtKDWOu1Fn5XZ5NUZ9EPfYrSMoDg8MtgYJ6MbpTGoBx7g_

 ----------------------------------------------------------------------------------------------------------------

顺便说一下chkconfig如何把postgresql添加到自启动列表,(背景:postgresql是用yum安装的)

1、用root登录

1、cd /etc/init.d/

2、chkconfig --add postgresql9.1

3、可以用chkconfig --list来查看启动列表

4、添加好以后就可以利用service postgresql9.1 start/stop/restart来控制它了。

refurl:http://www.cnblogs.com/mchina/archive/2012/06/06/2539003.html

 http://soft.chinabyte.com/os/494/12379994.shtml

猜你喜欢

转载自wandejun1012.iteye.com/blog/2005591
今日推荐