环境:以下命令仅适于redhat/centos,不适合于ubuntu.
先说共性吧:
chkconfig和service都可以作为服务启动,比如:
service postgresql start
或者
/etc/init.d/postgresql start
再说区别:
chkconfig除了可以启动服务外,还可以把服务添加到启动列表中。
所以可以狭窄的理解为:
service启动的服务在机器重启后将会失效。
而chkconfig添加的服务在机器重启后依然生效。
----------------------------------------------------------------------------------------------------------------
顺便说一下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
相关推荐
chkconfig 命令用于更新和查询系统服务的运行等级信息。它可查询操作系统在每一个运行等级中会自动执行哪些系统服务,包括各类常驻服务,比如 httpd、sshd、mysqld 等。 chkconfig 实际上是通过改变七个不同运行等级...
下面小编就为大家带来一篇浅谈RHEL 7中systemctl 的用法(替代service和chkconfig)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Linux下(CentOS 6.3 x64测试过)的Oracle service脚本。 使用方法 将oracle.txt上传到/etc/init.rd/oracle chkconfig --add oracle 之后就可以使用chkconfig, service命令进行oracle服务管理了。
mount /dev/hdc /mnt cd /mnt/Server rpm -ivh dhcp-3.0.5-18.el5.i386.rpm cp /media/disk/dhcpd.conf /etc/dhcpd.conf cd cd /mnt/Server rpm -ivh tftp-0.42-3.1.i386.rpm ...service dhcpd restart
开启: chkconfig iptables on 关闭: chkconfig iptables off 2)、 即时生效,重启后复原 开启: service iptables start 关闭: service iptables stop 3)、在当开启了防火墙时,做如下设置,开启相关端口, ...
在Linux系统下配置service启动和关闭 1, 通过命令cd /etc/init.d文件夹下 2, 再通过命令 vim tomcat 进入vim编辑界面 3,用过 i键 现在把下面代码贴入编辑界面 shell脚本如下 #!/bin/bash # This is the ...
[root@Service ~]# chkconfig tgtd on [root@Service ~]# echo '<target iqn.2015-05.com.grady:server.kite>'>> /etc/tgt/targets.conf [root@Service ~]# echo 'backing-store /dev/sdb'>> /etc/tgt/targets.conf...
service oraclectrl start --启动数据库与侦听 service oraclectrl start db --仅仅启动数据库 service oraclectrl start listener --仅仅启动侦听 service oraclectrl start em --启动web版企业管理器 其中stop 与...
#chkconfig: 2345 10 90 #description: test service .... LANG=en_US.UTF-8 #设置编码utf-8 export LANG export JAVA_HOME=/usr/java/jdk1.8.0_231-amd64 export JRE_HOME=/$JAVA_HOME/jre export CLASSPATH=.:$...
/home/share 192.168.100.4(sync,rw) 给192.168.100.4这台主机读和写的权限。 :wq 保存退出。 10.#cat /etc/exports 查看设置的访问权限。 11.#service portmap status #service nfs status 查看两个软件包的...
ESX 4.0默认是不打开Web Access服务的,如果要使用该功能,需要开启,方法如下: 1. 先确认服务的状态,在控制台输入以下命令: service vmware-webAccess status ...chkconfig --level 345 vmware-webAccess on
centos直接安装telnet-server-0.17-47.el6.x86_64.rmp会报错 “error: Failed ... chkconfig telnet on 4、安装telnet客户端 rpm -ivh telnet-clinet-0.17-47.el6.x86_64.rpm 5、重启xinetd service xinetd start
centos直接安装telnet-server-0.17-47.el6.x86_64.rmp会报错 “error: Failed ... chkconfig telnet on 4、安装telnet客户端 rpm -ivh telnet-clinet-0.17-47.el6.x86_64.rpm 5、重启xinetd service xinetd start
chkconfig iptables off centos7系统 systemctl stop firewalld.service systemctl disable firewalld.service 4、宝塔安装完后: 安装:nginx14 安装:mysql 5.6 安装:php 5.6 5、安装完成后修改在宝塔面板...
在linux系统中,安装完一个软件或应用后,有时候需要手动启动该应用,也需要收到将该应用添加到开机启动项中,让其可以能够在linux一开机...chkconfig SERVICE on|off CentOS 7 : systemctl enable|disable SERVICE 以
[root@lzwxhy1 home]# uname -a Linux lzwxhy1 2.6.32-431.el6.x86_64 #1 SMP ...service xinetd restart /etc/init.d/xinetd start netstat -nltp|grep xinetd chkconfig xinetd on chkconfig --list|grep xinetd
把文件上传到 /etc/init.d/ 设置执行权限:chmod +x /etc/init...设置开机启动:chkconfig nginx on 之后,就可以使用以下命令了 service nginx start service nginx stop service nginx restart service nginx reload
2.设置rpcbind和nfs服务开机自动启动 chkconfig nfs on chkconfig rpcbind on 3. 启动rpcbind和nfs服务,顺序不要弄反,反了会出现类似program not registered的错误 service rpcbind start service nfs start
ark-linux-server-service 当计算机启动时,自动启动ARK服务器,简单的命令即可停止,更新和启动服务器。 修改自 在Amazon EC2 AMI上测试先决条件: 按照官方说明来运行服务器。 屏幕: 百胜安装屏幕安装: 在/etc/...
hadoop2.2伪分布式集群搭建 ... service iptables status #关闭防火墙 service iptables stop #查看防火墙开机启动状态 chkconfig iptables --list #关闭防火墙开机启动 chkconfig iptables off