使用chkconfig管理redhat开机自启服务

一、重要的开机服务
1、sshd
2、rsyslog收集清理管理相关的日志
3、network
4、crond 定时任务 相当于闹钟
5、sysstat 软件集成包
方法一:
[root@webserver02 ~]#for i in $(chkconfig --list | awk '{print $1}');do chkconfig --level 3 $i off;done
[root@webserver02 ~]# chkconfig --list 查看是否全部被关闭。
[root@webserver02 ~]# for i in crond sshd network rsyslog sysstat;do chkconfig --level 3 $i on;done 使用for循环开启其中crond sshd network rsyslog sysstat 这几个服务
[root@webserver02 ~]# chkconfig --list | grep 3:on
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
方法二
[root@webserver02 ~]# chkconfig --list | grep 3:on|egrep -v "crond|sshd|network|rsyslog|sysstat"| awk '{print "chkconfig",$1,"off"}'
chkconfig abrt-ccpp off
chkconfig abrtd off
chkconfig acpid off
chkconfig atd off
chkconfig auditd off
chkconfig autofs off
chkconfig blk-availability off
chkconfig certmonger off
chkconfig cgconfig off
chkconfig cgred off
chkconfig cpuspeed off
chkconfig cups off
chkconfig haldaemon off
chkconfig ip6tables off
chkconfig iptables off
chkconfig irqbalance off
chkconfig kdump off
chkconfig lvm2-monitor off
chkconfig mcelogd off
chkconfig mdmonitor off
chkconfig messagebus off
chkconfig netconsole off
chkconfig netfs off
chkconfig nfs off
chkconfig nfslock off
chkconfig ntpd off
chkconfig ntpdate off
chkconfig numad off
chkconfig oddjobd off
chkconfig portreserve off
chkconfig postfix off
chkconfig psacct off
chkconfig quota_nld off
chkconfig rdisc off
chkconfig restorecond off
chkconfig rhnsd off
chkconfig rhsmcertd off
chkconfig rngd off
chkconfig rpcbind off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig rpcsvcgssd off
chkconfig saslauthd off
chkconfig smartd off
chkconfig sssd off
chkconfig udev-post off
chkconfig winbind off
chkconfig ypbind off
[root@webserver02 ~]# chkconfig --list | grep 3:on|egrep -v "crond|sshd|network|rsyslog|sysstat"| awk '{print "chkconfig",$1,"off"}'|bash
[root@webserver02 ~]# chkconfig --list |grep 3:on
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off

转载于:https://blog.51cto.com/11569838/2048735

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值