Linux常用命令 —— 进程类

service (CentOs6)

1、service   服务名   start         --------------   启动

2、service   服务名   stop         --------------   停止

3、serviec   服务名   restart      --------------   重启

4、service   服务名   reload       --------------   重新加载

5、service   服务名   status       --------------   查看服务状态

6、chkconfig --list                     --------------   查看服务状态

[lk@localhost ~]$ chkconfig   --list

注:该输出结果只显示 SysV 服务,并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。 

      要列出 systemd 服务,请执行 'systemctl list-unit-files'。
      查看在具体 target 启用的服务请执行
      'systemctl list-dependencies [target]'。

netconsole         0:关    1:关    2:关    3:关    4:关    5:关    6:关
network            0:关    1:关    2:开    3:开    4:开    5:开    6:关

7、查看服务的方法  /etc/init.d/服务名

8、通过chkconfig  命令设置自启动

  查看服务 chkconfig   --list |  grep  XXX

  修改服务级别  chkconfid   --level   5   服务名  on/off

 

 

systemctl(CentOs7)

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

  1.1、systemctl    start   服务名(xxx.service)

  1.2、systemctl    restart   服务名(xxx.service)

  1.3、systemctl    stop     服务名(xxx.service)

  1.4、systemctl    reload   服务名(xxx.service)

  1.5、systemctl    status    服务名(xxx.service)

2、查看服务的方法  /usr/lib/stsyemd/system

3、查看服务的命令

  3.1、systemctl   list-unit-files

  3.2、systemclt    --type  service

4、通过systemctl命令设置自启动

  4.1、自启动systemclt  enable   service_name

  4.2、不自启动systemctl  disable  service_name

 

转载于:https://www.cnblogs.com/karrya/p/11288938.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值