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  
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄