首页IT科技linux常用命令(Linux中chkconfig命令打开或关闭系统服务的使用教程)

linux常用命令(Linux中chkconfig命令打开或关闭系统服务的使用教程)

时间2025-05-02 18:28:14分类IT科技浏览4067
导读:chkconfig提供了一个维护/etc/rc[0~6] d 文件夹的命令行工具,它减轻了系统直接管理这些文件夹中的符号连接的负担。chkconfig主要包括5个原始功能:为系统管理增加新的服务、为系统管理移除服务、列出单签服务的启动信息、改变服务的启动信息和检查特殊服务的启动状态。当单独运行chkconfig命令而不加任何参数时...

chkconfig提供了一个维护/etc/rc[0~6] d 文件夹的命令行工具            ,它减轻了系统直接管理这些文件夹中的符号连接的负担            。chkconfig主要包括5个原始功能:为系统管理增加新的服务            、为系统管理移除服务                  、列出单签服务的启动信息      、改变服务的启动信息和检查特殊服务的启动状态                  。当单独运行chkconfig命令而不加任何参数时                  ,他将显示服务的使用信息      。

必要参数

--add 开启指定的服务程序

--del 关闭指定的服务程序

--list 列出chkconfig所知道的所有服务

选择参数

--level<代号> 设置服务程序的等级代号      ,它是一串0~7的数字      ,如“-level35            ”代表指定运行等级3和5

--help 显示帮助信息

--version 显示版本信息

用法1

[root@localhost www]# chkconfig --list #查看系统程序列表

[root@localhost www]# chkconfig httpd on #将httpd加入开机启动

[root@localhost www]# chkconfig httpd off #关闭httpd开机启动

用法2

代码如下:

[root@localhost tank]# chkconfig --add nginx #添加nginx启动脚本为chkconfig管理的一个服务

[root@localhost tank]# chkconfig --del nginx #删除chkconfig管理的的nginx启动服务

实例:

安装cent os 64位 后                  ,默认带了很不多不必要的服务            ,用以下命令列出:
代码如下:
chkconfig --list | grep :on

cups 打印服务 yum-updatesd 常在繁忙的时候占用大量CPU和内存 pcscd 智能卡      ,比如SD读卡器 hidd 和 bluetooth 蓝牙 cpuspeed 智能调节CPU                  ,笔记本用 firstboot 第一次安装完成后的引导设置 gpm 鼠标复制粘贴

代码如下:

chkconfig cups off

chkconfig yum-updatesd off

chkconfig pcscd off

chkconfig hidd off

chkconfig bluetooth off

chkconfig cpuspeed off

chkconfig firstboot off

chkconfig gpm off

以下的内容来源于网络            ,未考证功用

代码如下:

chkconfig rhnsd off

chkconfig anacron off

chkconfig arptables_jf off

chkconfig autofs off

chkconfig openibd off

chkconfig messagebus off

chkconfig rawdevices off

chkconfig canna off

chkconfig atd off

chkconfig iiim off

chkconfig pcmcia off

chkconfig haldaemon off

chkconfig iptables off

chkconfig mdmonitor off

chkconfig hpoj off

#chkconfig nfslock off

chkconfig acpid off

chkconfig sendmail off

chkconfig cups off

chkconfig isdn off

chkconfig irqbalance off

chkconfig microcode_ctl off

chkconfig cups-config-daemon off

chkconfig ip6tables off

其他: 关闭nfs相关服务 关闭rpc相关服务

关闭
代码如下:
SELinux vi /etc/selinux/config
声明:本站所有文章,如无特殊说明或标注                  ,均为本站原创发布      。任何个人或组织                  ,在未征得本站同意时,禁止复制            、盗用                  、采集      、发布本站内容到任何网站      、书籍等各类媒体平台                  。如若本站内容侵犯了原著者的合法权益            ,可联系我们进行处理            。

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
探索海洋科学手抄报图片(探索海洋CMS模板免费下载:让网站建设更加简单) xp时间修改后又复原(电脑系统xp时间出错不能修改时间解决方案)