linux命令chkconfig介绍和使用案例

韵味老鸟 2024-09-02 13:24:43

linux 命令chkconfig 介绍和使用案例

chkconfig 命令是 Linux 系统中用于管理系统服务的工具,主要用于更新、查询和修改不同运行级上的服务状态。它允许用户控制服务在系统启动时的启用或禁用状态

基本语法bashchkconfig [--add] [--del] [--list] [service_name] chkconfig [--level <levels>] service_name [on|off|reset]常用选项--add:添加指定的系统服务,使其由 chkconfig 管理,并在系统启动配置中增加相关数据。--del:删除指定的系统服务,使其不再由 chkconfig 管理,并从启动配置中删除相关数据。--list:列出所有服务及其在不同运行级的状态(on 或 off)。--level <levels>:指定在哪些运行级下启用或禁用服务。on:在指定的运行级下启用服务。off:在指定的运行级下禁用服务。reset:重置服务的启动信息。运行级别0:关机1:单用户模式2:无网络连接的多用户模式3:有网络连接的多用户命令行模式4:保留5:带图形界面的多用户模式6:重启

#ubuntu 系统

root@meng:~# which ckconfig

root@meng:~# which chkconfig

root@meng:~# chkconfig --list

chkconfig: command not found

root@meng:~# apt install chkconfig

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Package chkconfig is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package 'chkconfig' has no installation candidate

root@meng:~# cat /etc/issue

Ubuntu 22.04.2 LTS \n \l

root@meng:~# lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 22.04.2 LTS

Release: 22.04

Codename: jammy

0 阅读:1

韵味老鸟

简介:感谢大家的关注