linux chkconfig

--list 后面可以加 服务名称 就只输出此服务的信息

例如

#chkconfig httpd on

就可以把httpd服务 设置为自动启动了

再次查看

#chkconfig --list httpd

httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

这个时候2~5都是on,设置成功。

相反的

#chkconfig httpd off 就是 关闭自动启动

最后 还有个 --level 应该是对 0-6 某些 等级进行单独设置

#chkconfig --level 35 httpd on 将3和5 设置成on

===========================================
[root@DBSVR02 ~]# chkconfig --list
abrt-ccpp       0:off   1:off   2:off   3:on    4:off   5:on    6:off
abrt-oops       0:off   1:off   2:off   3:on    4:off   5:on    6:off
abrtd           0:off   1:off   2:off   3:on    4:off   5:on    6:off
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off
certmonger      0:off   1:off   2:off   3:on    4:on    5:on    6:off
cgconfig        0:off   1:off   2:off   3:off   4:off   5:off   6:off
cgred           0:off   1:off   2:off   3:off   4:off   5:off   6:off

==========================================
[root@DBSVR02 ~]# service --list
--list: unrecognized service
[root@DBSVR02 ~]#
==========================================
[root@DBSVR02 ~]# service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
[root@DBSVR02 ~]# service vsftpd status
vsftpd: unrecognized service
[root@DBSVR02 ~]# service --status-all | grep vsftpd
[root@DBSVR02 ~]#
=========================================


[root@DBSVR02 etc]# yum search vsftpd
Loaded plugins: downloadonly, fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirrors.grandcloud.cn
 * extras: mirrors.grandcloud.cn
 * updates: mirrors.grandcloud.cn
base                                                                         | 3.7 kB     00:00
extras                                                                       | 3.5 kB     00:00
updates                                                                      | 3.5 kB     00:00
======================================= N/S Matched: vsftpd ========================================
vsftpd.i686 : Very Secure Ftp Daemon

  Name and summary matches only, use "search all" for everything.
[root@DBSVR02 etc]# yum install vsftpd.i686
Loaded plugins: downloadonly, fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirrors.grandcloud.cn
 * extras: mirrors.grandcloud.cn
 * updates: mirrors.grandcloud.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.i686 0:2.2.2-11.el6_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch               Version                        Repository             Size
====================================================================================================
Installing:
 vsftpd               i686               2.2.2-11.el6_4.1               updates               157 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 157 k
Installed size: 344 k
Is this ok [y/N]: y
Downloading Packages:
vsftpd-2.2.2-11.el6_4.1.i686.rpm                                             | 157 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : vsftpd-2.2.2-11.el6_4.1.i686                                                     1/1
  Verifying  : vsftpd-2.2.2-11.el6_4.1.i686                                                     1/1

Installed:
  vsftpd.i686 0:2.2.2-11.el6_4.1

Complete!
[root@DBSVR02 etc]# service vsftpd status
vsftpd is stopped
[root@DBSVR02 etc]#

posted on 2013-05-04 07:17  simhare  阅读(416)  评论(0编辑  收藏  举报

导航