网易蜂巢 centos 7.0 为什么没有 service 命令呢?

vps网友提供 05-22 讨论归档 23

难道网易连 service 服务都要禁止吗?本来说搭建个 web 服务器和免流的,结果发现好像有禁止什么?求解答。

本文由 vps网友提供,转载请注明出处

本文链接: https://www.vpsvsvps.com/discuss/a/1676471754228240384.html

标签:
Neveroldmilk
05-23

换成了 systemd 了。

dybeta
05-23

@owt5008137 谢谢。

owt5008137
05-23

我刚开始用 Centos 7 的时候也看了半天文档整理了一些常用的 firewalld 和 systemd 的命令希望对你有用
https://www.owent.net/mzMqY

anyforever
05-23

@hinkal +1

dybeta
05-22

还是这里大神多,感觉用习惯了 service 突然换 systemctl 有点不习惯。

HanSonJ
05-22

@znoodl 命令反了

CyrixIII
05-22

systemctl start/stop/restart nginx.service

Balthild
05-22

@forvtwoex
alias sctl="systemctl"

Balthild
05-22

我用过的大部分 CentOS 里面, service 命令是被重定向到 systemctl 的,但也不会没有 service 命令吧………

tolbkni
05-22

有的,但是最终被转换成 systemctl 命令了,这种情况应该是被精简掉了

Jaylee
05-22

都 centos7 了,还哪来的 service ...

julyclyde
05-22

service 命令,古代是在 CentOS5 的 systemV init 里搭配使用的
后来 CentOS6 、 upstart 的时候, Redhat 文档里说 service “也可以”管理 upstart 的服务,但实际上是不行的
CentOS7 里 systemd 根本就没这个

forvtwoex
05-22

用了 systemctl ,一下子觉得不习惯了,字母长了好多

Tink
05-22

现在用 service 的不多了吧,大多数都是 systemctl

dybeta
05-22

谢谢您们,主要是我之前用阿里云上都有,所以我就好奇,谢谢。

zhs227
05-22

用的是 systemd. 命令是 systemctl

或者 sudo yum install initscripts -y

initscripts 提供了 service 的命令,但核心还是调用 systemctl

hinkal
05-22

centos 7 就是没有 service 的,用 systemctl 替代了

znoodl
05-22

CentOS7 把 CentOS6 的 System V init 换成 Systemd 了
有 systemctl httpd start
设置开机启动 systemctl httpd enable 更方便

adrianzhang
05-22

另外,我记得目前的主流最新版本都在用 systemd 来接管 init ,所以没有 service 也正常。

adrianzhang
05-22

没有 service 可以用 /etc/rc.d/init.d/httpd restart 这样的形式完成。