红联Linux门户
Linux帮助

Linux系统服务启动与停止

发布时间:2014-06-10 15:22:47来源:红联作者:velcbo
1. 查看Linux启动的服务

chkconfig --list 查询出所有当前运行的服务

chkconfig --list atd 查询atd服务的当前状态

2.停止所有服务并且在下次系统启动时不再启动,如下所示:

chkconfig --levels 12345 NetworkManager off

如果想查看当前处于运行状态的服务,用如下语句过滤即可

chkconfig --list |grep on

3.如果只是想当前的设置状态有效,在系统重启动后即不生效的话,可以用如下命令停止服务

service sshd stop

示例,可以把不需要启动的服务写入到一个脚本中,直接用sh 文件名一执行就可以了
chkconfig --levels 0123456 NetworkManager off
chkconfig --levels 0123456 anacron off
chkconfig --levels 0123456 auditd off
chkconfig --levels 0123456 avahi-daemon off
chkconfig --levels 0123456 bluetooth off
chkconfig --levels 0123456 clvmd off
chkconfig --levels 0123456 cman off
chkconfig --levels 0123456 cups off
chkconfig --levels 0123456 gfs off
chkconfig --levels 0123456 gfs2 off
chkconfig --levels 0123456 hidd off
chkconfig --levels 0123456 httpd off
chkconfig --levels 0123456 iptables off
chkconfig --levels 0123456 ip6tables off
chkconfig --levels 0123456 ipvsadm off
chkconfig --levels 0123456 luci off
chkconfig --levels 0123456 mcstrans off
chkconfig --levels 0123456 pand off
chkconfig --levels 0123456 Nrestorecond off
chkconfig --levels 0123456 ricci off
chkconfig --levels 0123456 rmanager off
chkconfig --levels 0123456 saslauthd off
chkconfig --levels 0123456 sendmail off
chkconfig --levels 0123456 smb off
chkconfig --levels 0123456 snmp off
chkconfig --levels 0123456 snmptrapd off
chkconfig --levels 0123456 tog-pegasus off
chkconfig --levels 0123456 wdaemon off

作者:cqboy1991
文章评论

共有 0 条评论