systemctl list-units 列出所有启动unit
systemctl list-unit-files 列出所有启动文件
systemctl list-units –type=service –all 列出所有service类型的unit
systemctl list-units –type=target –all 列出所有target
systemctl list-dependencies #查看当前运行级别target(mult-user)启动了哪些服务
systemctl status udhcpd 查看udhcpd 服务的状态
可能的返回值
- loaded 系统服务初始化完成,加载了配置
- active(running) 正有一个或多个程序正在系统中执行, vsftpd就是这种模式
- atcive(exited) 仅执行一次就正常结束的服务, 目前并沒有任何程序在系統中执行
- atcive(waiting)正在执行当中,不过还在等待其他的事件才能继续处理
- inactive 服务关闭
- enbaled 服务开机启动
- disabled 服务开机不自启
- static 服务开机启动项不可被管理
- failed 系统配置错误
systemctl enable udhcpd 建立 ushcpd.service 链接,使能服务
systemctl disable udhcpd 删除ushcpd.service 链接,禁止服务
systemctl start udhcp 启动服务
systemctl stop udhcp 停止服务
systemctl restart udhcp 重新启动服务
systemctl reload-daemon 加载新的unit 配置文件