Linux常用服务类相关命令

Linux常用服务类相关命令

service(centos6)
  • 注册在系统中的标准化层序

  • 有方便统一的管理方式(常用的方法)

    • service 服务名 start
    • service 服务名 stop
    • service 服务名 restart
    • service 服务名 reload
    • service 服务名 status
  • 查看服务的方法 /etc/init.d/服务名

  • 通过chkconfig 命令设置自启动

    • 查看服务 chkconfig --list|grep xxx

    • chkconfig --level 5 服务名 on

      (on 是启动,off是关闭)


systemctl(centos7)
  • 注册在系统中的标准化程序
  • 有方便统一的管理方式(常用的方法)
    • systemctl start 服务名(xxxx.service)
    • systemctl restart 服务名(xxxx.service)
    • systemctl stop 服务名(xxxx.service)
    • systemctl reload 服务名(xxxx.service)
    • systemctl status 服务名(xxxx.service)
  • 查看服务的方法 /usr/lib/systemd/system
  • 查看服务的命令
    • systemctl list-unit-files
    • systemctl --type service
  • 通过systemctl命令设置自启动
    • 自启动systemctl enable service_name
    • 不自启动systemctl disable serivice_name
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值