service与chkconfig的替代者systemctl

技术文档网 2021-04-19

在安装 redis 时,看到将 redis 配置成 service 系统服务后,采用 service redisd start 命令启动;
在安装 mariadb 时,看到利用 systemctl start mariadb 命令启动 mariadb。
于是乎想 systemctl start redis 是否可以启动 redis,验证时可以的。
那么 systemcltservice 的区别是什么?
网上查询得到的答案是: systemctlservicechkconfig 的替代命令

下面看看区别:

任务 旧指令 新指令
检查服务状态 service redisd status systemctl status redis
启动某服务 service redisd start systemclt start redis
停止某服务 service redisd stop systemclt stop redis
重启某服务 service redisd restart systemctl restart redis
使某服务自动启动 chkconfig --level 3 redisd on systemctl enable redis
使某服务不自动启动 chkconfig --level 3 redisd off systemctl disable redis
加入自动义服务 chkconfig --add test systemctl load test.service
加入自动义服务 chkconfig --del test 停掉应用,删除相应的配置文件
显示所有已启动的服务 chkconfig --list systemctl list-units --type=service

相关文章

  1. Linux iptables学习笔记

    最近工作需要跟firewall打交道,在这里写下自己的使用心得。 firewall主要的特性有: 1.支持区域设置 2.运行时跟持久化的配置是分离的 3.能够动态管理 iptables 不管是从

  2. Linux vim命令使用教程

    vim使用 参考链接 vim4种模式: 普通模式 插入模式 可视模式 命令行模式 进入vim,按下i或a进入插入模式 按ESC进入普通模式 在该模式下可以使用方向键 h向左 j向下 k向上

  3. 校准linux系统时间

    服务器的时间对于记录请求和数据库操作时间具有重要意义,对于一些如数据库备份的操作,时间尤为重要,需要避开白天业务繁忙时间进行。 修改时区 # cp /etc/localtime /etc/localt

  4. yum与rpm使用说明

    rpm 命令 rpm 命令是 RPM 软件包的管理工具。 语法 rpm (选项)(参数) 选项 -h:安装时列出标记;-i:安装时显示套件的相关信息;-v:安装时显示指令执行过程;-e:卸载已安

  5. service与chkconfig的替代者systemctl

    在安装 redis 时,看到将 redis 配置成 service 系统服务后,采用 service redisd start 命令启动;在安装 mariadb 时,看到利用 systemctl st

随机推荐

  1. Linux iptables学习笔记

    最近工作需要跟firewall打交道,在这里写下自己的使用心得。 firewall主要的特性有: 1.支持区域设置 2.运行时跟持久化的配置是分离的 3.能够动态管理 iptables 不管是从

  2. Linux vim命令使用教程

    vim使用 参考链接 vim4种模式: 普通模式 插入模式 可视模式 命令行模式 进入vim,按下i或a进入插入模式 按ESC进入普通模式 在该模式下可以使用方向键 h向左 j向下 k向上

  3. 校准linux系统时间

    服务器的时间对于记录请求和数据库操作时间具有重要意义,对于一些如数据库备份的操作,时间尤为重要,需要避开白天业务繁忙时间进行。 修改时区 # cp /etc/localtime /etc/localt

  4. yum与rpm使用说明

    rpm 命令 rpm 命令是 RPM 软件包的管理工具。 语法 rpm (选项)(参数) 选项 -h:安装时列出标记;-i:安装时显示套件的相关信息;-v:安装时显示指令执行过程;-e:卸载已安

  5. service与chkconfig的替代者systemctl

    在安装 redis 时,看到将 redis 配置成 service 系统服务后,采用 service redisd start 命令启动;在安装 mariadb 时,看到利用 systemctl st