如何启动和停止服务?
可能重复:
启用/禁用服务的推荐方法是什么?
除了以下内容之外,还有其他命令在ubuntu中启动停止重启服务吗?
service --status-all
-
service stop
-
sudosysv-rc-conf
这在很大程度上取决于服务。 停止启动和重新启动服务的新方法是通过/etc/init.d
。 因此,例如,要停止或启动Apache Webserver,您就可以运行
/etc/init.d/apache2 stop
/etc/init.d/apache2 start
许多其他服务也是如此,但可能并非全部。 您可以使用实用程序sysv-rc-conf
查看使用init.d
脚本的服务,并以这种方式管理它们。 用sudo sysv-rc-conf
运行它。
如果您正在寻找GUI应用程序,请尝试启动管理器。 安装时
apt-get install bum
并从UI或终端运行
sudo bum
用法和文档可以在这里找到。
您可以使用以下命令:
service stop service start service restart
注意service --status-all
不会停止或启动任何东西,它只返回一个状态(并且其中有一些已知的错误 )。
如果你有upstart
那么你可以使用这些:
stop start restart