service与chkconfig的替代者systemctl
在安装 redis 时,看到将 redis 配置成 service 系统服务后,采用 service redisd start
命令启动;
在安装 mariadb 时,看到利用 systemctl start mariadb
命令启动 mariadb。
于是乎想 systemctl start redis
是否可以启动 redis,验证时可以的。
那么 systemclt
与 service
的区别是什么?
网上查询得到的答案是: systemctl
是 service
和 chkconfig
的替代命令。
下面看看区别:
任务 | 旧指令 | 新指令 |
---|---|---|
检查服务状态 | 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 |
相关文章
- Linux iptables学习笔记
最近工作需要跟firewall打交道,在这里写下自己的使用心得。 firewall主要的特性有: 1.支持区域设置 2.运行时跟持久化的配置是分离的 3.能够动态管理 iptables 不管是从
- Linux vim命令使用教程
vim使用 参考链接 vim4种模式: 普通模式 插入模式 可视模式 命令行模式 进入vim,按下i或a进入插入模式 按ESC进入普通模式 在该模式下可以使用方向键 h向左 j向下 k向上
- 校准linux系统时间
服务器的时间对于记录请求和数据库操作时间具有重要意义,对于一些如数据库备份的操作,时间尤为重要,需要避开白天业务繁忙时间进行。 修改时区 # cp /etc/localtime /etc/localt
- yum与rpm使用说明
rpm 命令 rpm 命令是 RPM 软件包的管理工具。 语法 rpm (选项)(参数) 选项 -h:安装时列出标记;-i:安装时显示套件的相关信息;-v:安装时显示指令执行过程;-e:卸载已安
- service与chkconfig的替代者systemctl
在安装 redis 时,看到将 redis 配置成 service 系统服务后,采用 service redisd start 命令启动;在安装 mariadb 时,看到利用 systemctl st
随机推荐
- Linux iptables学习笔记
最近工作需要跟firewall打交道,在这里写下自己的使用心得。 firewall主要的特性有: 1.支持区域设置 2.运行时跟持久化的配置是分离的 3.能够动态管理 iptables 不管是从
- Linux vim命令使用教程
vim使用 参考链接 vim4种模式: 普通模式 插入模式 可视模式 命令行模式 进入vim,按下i或a进入插入模式 按ESC进入普通模式 在该模式下可以使用方向键 h向左 j向下 k向上
- 校准linux系统时间
服务器的时间对于记录请求和数据库操作时间具有重要意义,对于一些如数据库备份的操作,时间尤为重要,需要避开白天业务繁忙时间进行。 修改时区 # cp /etc/localtime /etc/localt
- yum与rpm使用说明
rpm 命令 rpm 命令是 RPM 软件包的管理工具。 语法 rpm (选项)(参数) 选项 -h:安装时列出标记;-i:安装时显示套件的相关信息;-v:安装时显示指令执行过程;-e:卸载已安
- service与chkconfig的替代者systemctl
在安装 redis 时,看到将 redis 配置成 service 系统服务后,采用 service redisd start 命令启动;在安装 mariadb 时,看到利用 systemctl st