难道网易连 service 服务都要禁止吗?本来说搭建个 web 服务器和免流的,结果发现好像有禁止什么?求解答。
回复
@owt5008137 谢谢。
我刚开始用 Centos 7 的时候也看了半天文档整理了一些常用的 firewalld 和 systemd 的命令希望对你有用
https://www.owent.net/mzMqY
@hinkal +1
还是这里大神多,感觉用习惯了 service 突然换 systemctl 有点不习惯。
@znoodl 命令反了
systemctl start/stop/restart nginx.service
@forvtwoex
alias sctl="systemctl"
我用过的大部分 CentOS 里面, service 命令是被重定向到 systemctl 的,但也不会没有 service 命令吧………
有的,但是最终被转换成 systemctl 命令了,这种情况应该是被精简掉了
都 centos7 了,还哪来的 service ...
service 命令,古代是在 CentOS5 的 systemV init 里搭配使用的
后来 CentOS6 、 upstart 的时候, Redhat 文档里说 service “也可以”管理 upstart 的服务,但实际上是不行的
CentOS7 里 systemd 根本就没这个
用了 systemctl ,一下子觉得不习惯了,字母长了好多
现在用 service 的不多了吧,大多数都是 systemctl
谢谢您们,主要是我之前用阿里云上都有,所以我就好奇,谢谢。
用的是 systemd. 命令是 systemctl
或者 sudo yum install initscripts -y
initscripts 提供了 service 的命令,但核心还是调用 systemctl
centos 7 就是没有 service 的,用 systemctl 替代了
CentOS7 把 CentOS6 的 System V init 换成 Systemd 了
有 systemctl httpd start
设置开机启动 systemctl httpd enable 更方便
另外,我记得目前的主流最新版本都在用 systemd 来接管 init ,所以没有 service 也正常。
没有 service 可以用 /etc/rc.d/init.d/httpd restart 这样的形式完成。
换成了 systemd 了。