Linux下面开起启动服务命令(chkconfig、ntsysv)!

netstat可用查看目前已经启动的服务,service可以用来立即启动某个服务。chkconfig用来设置服务在开机的时候自动启动。

--查看nfs服务是否开机自动启动。可以看见6个开机级别都不会启动nfs服务。
[root@db ~]# chkconfig  --list nfs
nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off

--设置开机自动启动nfs服务。
[root@db ~]# chkconfig  nfs on

--再次查看,可以看见2、3、4、5级别开机会自动启动nfs服务。
[root@db ~]# chkconfig  --list nfs
nfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off

--取消开机自动启动nfs服务。
[root@db ~]# chkconfig nfs off

--再次查看,6个级别开机又都不会启动nfs服务了。
[root@db ~]# chkconfig  --list nfs
nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off

--设置3级别开机自动启动nfs服务。
[root@db ~]# chkconfig --level 3 nfs on

--再次查看,可以看见在级别开机会自动启动nfs服务。
[root@db ~]# chkconfig --list nfs
nfs             0:off   1:off   2:off   3:on    4:off   5:off   6:off

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

ntsysv:类图形界面管理模式来设置开机启动。(redhat特有的,基本上chkconfig就很好用了。)

总结一下功能按钮:
上下键:可以在中间的方框当中,在各个服务之间移动;
空格键:可以用来选择你所需要的服务,[*]表示开起启动;
tab键:可以在方框、OK、Cancel之间移动;
[F1]键:可以显示该服务的说明。      
例如:

[root@linux ~]# ntsysv
ntsysv 1.3.30.1 - (C) 2000-2001 Red Hat, Inc.                                                                                                                                                   
                                                                                                                                                                                                
                                                                                                                                                                                                
                                                                               +------------+ 服务 +------------+                                                                               
                                                                               |                                |                                                                               
                                                                               | 您想自动启动哪些服务?         |                                                                               
                                                                               |                                |                                                                               
                                                                               |     [ ] NetworkManager         |                                                                               
                                                                               |     [*] acpid                  |                                                                               
                                                                               |     [ ] amanda           a     |                                                                               
                                                                               |     [ ] amd              a     |                                                                               
                                                                               |     [*] anacron          a     |                                                                               
                                                                               |     [*] apmd             a     |                                                                               
                                                                               |     [*] arptables_jf     a     |                                                                               
                                                                               |     [ ] arpwatch         a     |                                                                               
                                                                               |     [*] atd              a     |                                                                               
                                                                               |     [*] auditd           a     |                                                                               
                                                                               |     [ ] auth             a     |                                                                               
                                                                               |     [*] autofs           a     |                                                                               
                                                                               |     [*] avahi-daemon     a     |                                                                               
                                                                               |     [ ] avahi-dnsconfd   a     |                                                                               
                                                                               |     [*] bluetooth        a     |                                                                               
                                                                               |     [ ] capi             a     |                                                                               
                                                                               |     [ ] chargen-dgram    a     |                                                                               
                                                                               |     [ ] chargen-stream   a     |                                                                               
                                                                               |     [ ] conman           a     |                                                                               
                                                                               |     [*] cpuspeed         a     |                                                                               
                                                                               |     [*] crond            a     |                                                                               
                                                                               |     [*] cups             a     |                                                                               
                                                                               |     [ ] cvs              a     |                                                                               
                                                                               |     [ ] daytime-dgram    a     |                                                                               
                                                                               |     [ ] daytime-stream         |                                                                               
                                                                               |                                |                                                                               
                                                                               |    +------+       +------+     |                                                                               
                                                                               |    | 确定 |       | 取消 |     |                                                                               
                                                                               |    +------+       +------+     |                                                                               
                                                                               |                                |                                                                               
                                                                               |                                |                                                                               
                                                                               +--------------------------------+                                                                               
                                                                                                                                                                                                
                                                                                                                                                                                                

按 <F1> 可获取关于某项服务的详情。      

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值