← 返回命令列表

Linux command

chkconfig 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List

chkconfig --list

Example

chkconfig --list [ntpd]

Enable

chkconfig [sshd] on

Example

chkconfig --level [2345] [sshd] on

Disable

chkconfig [ntpd] off

Example

chkconfig --level [3] [ntpd] off

说明

chkconfig manages service runlevels on Red Hat-based Linux systems using SysVinit. It updates the symbolic links in /etc/rc.d/ directories that control which services start at each runlevel. This tool is primarily used on CentOS 6 and older RHEL systems. Modern systems using systemd should use systemctl instead.

参数

--list _name_
List all services or a specific service's runlevels
--level _levels_
Specify which runlevels to affect (e.g., 2345)
--add _name_
Add a new service for management
--del _name_
Remove a service from management

FAQ

What is the chkconfig command used for?

chkconfig manages service runlevels on Red Hat-based Linux systems using SysVinit. It updates the symbolic links in /etc/rc.d/ directories that control which services start at each runlevel. This tool is primarily used on CentOS 6 and older RHEL systems. Modern systems using systemd should use systemctl instead.

How do I run a basic chkconfig example?

Run `chkconfig --list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --list _name_ do in chkconfig?

List all services or a specific service's runlevels