systemd 一些命令


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 服务的状态

可能的返回值

  1. loaded  系统服务初始化完成,加载了配置
  2. active(running) 正有一个或多个程序正在系统中执行, vsftpd就是这种模式
  3. atcive(exited) 仅执行一次就正常结束的服务, 目前并沒有任何程序在系統中执行
  4. atcive(waiting)正在执行当中,不过还在等待其他的事件才能继续处理
  5. inactive 服务关闭
  6. enbaled 服务开机启动
  7. disabled 服务开机不自启
  8. static 服务开机启动项不可被管理
  9. failed 系统配置错误

systemctl enable udhcpd  建立 ushcpd.service 链接,使能服务

systemctl disable udhcpd  删除ushcpd.service 链接,禁止服务

 

systemctl start udhcp 启动服务

systemctl stop udhcp  停止服务

systemctl restart udhcp  重新启动服务

systemctl reload-daemon  加载新的unit 配置文件  

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值