<分区>
这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。
关闭去年。
社区在 去年 审查了是否重新打开这个问题并让它关闭:
原始关闭原因未解决
<分区>
这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。
关闭去年。
社区在 去年 审查了是否重新打开这个问题并让它关闭:
原始关闭原因未解决
我总是以这种方式运行我的 Apache 服务器:
sudo service apache2 start
但是在很多指南中我看到这样的命令:
sudo systemctl start apache2
谁能简短地写出这些命令之间的区别,并就我在日常工作中应该使用什么命令给我建议?
最佳答案
service
对 /etc/init.d 中的文件进行操作,并与旧的 init 系统结合使用。 systemctl
对 /lib/systemd 中的文件进行操作。如果在 /lib/systemd 中有您的服务的文件,它将首先使用该文件,如果没有,它将回退到 /etc/init.d 中的文件。
此外,如果您使用的是像 ubuntu-14.04 这样的操作系统,则只有服务命令可用。
所以如果systemctl可用,最好使用它
关于apache - Systemctl和服务命令的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43537851/