11.10 chkconfig:管理开机服务

chkconfig 命令是Redhat系列的Linux系统中的系统服务管理工具,它能够用于查询和更新不一样的运行等级下系统服务的启动状态。

chkconfig命令的参数选项及说明

--list    显示不一样运行级别下服务的启动状态
--add     添加一个系统服务
--del     删除一个系统服务
--level   指定运行级别

如下是运行级别说明。
0:关机。
1:单用户模式。
2:没有网络的多用户模式。
3:彻底的多用户模式。
4:没有使用的级别。
5:图形界面多用户模式。
6:重启。

了解chkconfig原理。
chkconfig 的原理是在 runlevel级别的 /etc/rc.d/rc*.d目录中将对应服务作一个以S或K开头的软连接。

[root@linuxprobe ~]# ll /etc/rc.d/rc3.d/             
total 0
lrwxrwxrwx. 1 root root 20 Jan 28 21:13 K50netconsole -> ../init.d/netconsole
lrwxrwxrwx. 1 root root 17 Jan 28 21:13 S10network -> ../init.d/network


下面只对rc3.d目录作实验,chkconfig的--level2345是同时对re2.d、rc3.d、re4.d、rc5.d这4个目录进行操做的。







centos 7 下面使用 systemctl list-unit-files 查看自启任务
[root@linuxprobe ~]# systemctl list-unit-files
UNIT FILE STATE   
proc-sys-fs-binfmt_misc.automount static  
dev-hugepages.mount static  
dev-mqueue.mount static  
proc-fs-nfsd.mount static  
proc-sys-fs-binfmt_misc.mount static  
sys-fs-fuse-connections.mount static  
sys-kernel-config.mount static  
sys-kernel-debug.mount static  
tmp.mount disabled
var-lib-nfs-rpc_pipefs.mount static  
brandbot.path disabled
systemd-ask-password-console.path static  
相关文章
相关标签/搜索