systemctl 命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。
| 任务 | 旧指令 | 新指令 |
| 使某服务自动启动 | chkconfig --level 3 httpd on | systemctl enable httpd.service |
| 使某服务不自动启动 | chkconfig --level 3 httpd off | systemctl disable httpd.service |
| 检查服务状态 | service httpd status | systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active) |
| 显示所有已启动的服务 | chkconfig --list | systemctl list-units --type=service |
| 启动某服务 | service httpd start | systemctl start httpd.service |
| 停止某服务 | service httpd stop | systemctl stop httpd.service |
| 重启某服务 | service httpd restart | systemctl restart httpd.service |
实例
1.启动nfs服务
systemctl start nfs-server.service
2.设置开机自启动
systemctl enable nfs-server.service
3.停止开机自启动
systemctl disable nfs-server.service
4.查看服务当前状态
systemctl status nfs-server.service
5.重新启动某服务
systemctl restart nfs-server.service
6.查看所有已启动的服务
systemctl list-units --type=service
开启防火墙22端口
iptables -I INPUT -p tcp --dport 22 -j accept
如果仍然有问题,就可能是SELinux导致的
关闭SElinux:
修改/etc/selinux/config文件中的SELINUX=””为disabled,然后重启。
彻底关闭防火墙:
sudo systemctl status firewalld.service
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
参考资料:
http://man.linuxde.net/systemctl
https://blog.csdn.net/u012486840/article/details/53161574
http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html
systemctl 命令的更多相关文章
- Centos7中systemctl命令详解
Linux Systemctl是一个系统管理守护进程.工具和库的集合,用于取代System V.service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器.通过Syst ...
- 【搬运】systemctl 命令完全指南
Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器. Systemd是一个系统管理守护进程.工具和库的集合,用于取代System V初始进程.Systemd的功能是 ...
- systemctl命令用法详解
systemctl命令用法详解系统环境:Fedora 16binpath:/bin/systemctlpackage:systemd-units systemctl enable httpd.serv ...
- centos7 systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 实例: 启动nfs服务:systemctl start nfs-server.s ...
- systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 ...
- centos7中systemctl命令使用方法和心得体会
使用linux的同学对service和chkconfig两个命令都不陌生,其重要性不言而喻,那么怎么会突然冒出个systemctl命令呢?其实,为了简化操作,systemctl命令将service和c ...
- systemctl 命令完全指南
http://www.linuxidc.com/Linux/2015-07/120833.htm Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器. System ...
- (转)systemctl 命令完全指南
场景:在使用chkconfig查看vsftpd是否看机启动时候看不到启动项,用systemctl 才看到自己想要的结果 1 总结 from:https://linux.cn/article-5926- ...
- Linux systemctl 命令完全指南
Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器. Systemd是一个系统管理守护进程.工具和库的集合,用于取代System V初始进程.Systemd的功能是 ...
- Linux服务器,服务管理--systemctl命令详解,设置开机自启动
Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了. 摘要: syst ...
随机推荐
- ZH奶酪:PHP (爬虫)下载图片
原文地址:http://www.phpfensi.com/php/20140107/1128.html 通过图片地地址把图片保存到本址,这里我们直接通过readfile读取然后通过fopen保存即可, ...
- AT&T汇编和Intel汇编语法主要区别
AT&T使用$表示立即操作数,而Intel的立即操作数是不需要界定的.因此,使用AT&T语法引用十进制值4时,使用$4,使用Intel语法时只需使用4. AT&T在寄存器名 ...
- [OpenGL] 斯坦福兔子与显示列表
1.调整桌子的大小. 在OpenGL绘制长方体,能够通过函数: glutSolidCube(Size) 绘制得到的是一个正方体,再利用缩放矩阵使其变成长方体.使得桌子 ...
- ES6学习笔记十:模块的导入、导出
一:模块导入 1) import { 要导入的属性.方法民 } from '模块路径'; 2)该种方法需要有配置文件,指明模块所在路径 import { 要导入的属性.方法民 } from '模块名' ...
- Python学习笔记二:函数式编程
1:Python中,内置函数名相当于一个变量,指向内置函数.所以可以通过函数名调用相应函数,也可以给函数名赋值,改变它的内容,如:可以把另一个函数变量赋值给它,那它就指向了所赋值的函数了. 2:高级函 ...
- dpkg: warning: files list file for package `*****' missing, assuming package has no files currently installed解决办法
一个好友的国外VPS由于操作不当,结果装软件的时候总是提示dpkg: warning: files list file for package `*****' missing, assuming pa ...
- .NET 工具生成引擎概述
Mark Michaelis 微软中国MSDN 过去几年大家一直都在使用 .NET Core(有这么久吗?)并且都知道“生成系统”经历了重大改变,不论是终止对 Gulp 的内置支持,还是放弃 Proj ...
- 〖Linux〗Kubuntu设置打开应用时就只在打开时的工作区显示
有没有遇到一种情况: 在工作区1打开了应用程序Google Chrome: 这个时间感觉它打开速度比较慢,就快捷键切换到工作区2了: 结果这个时候,Google Chrome就直接在工作区2打开,多不 ...
- 一起talk C栗子吧(第八十五回:C语言实例--使用信号进行进程间通信二)
各位看官们,大家好,上一回中咱们说的是使用信号进行进程间通信的样例,这一回咱们接着上一回的内容,继续说该样例.闲话休提.言归正转. 让我们一起talk C栗子吧. 我们在上一回中举了使用信号进行进程间 ...
- redis实现简单的分布式锁
在分布式系统中多个请求并发对少数资源进行争抢,例如10个人同时秒杀一件商品,如果不用分布式的锁进行处理(当然还有其它的处理方案),则很容易出现多个人抢到一个商品(超卖)的情况,用redis可以比较容易 ...