前言
该问题翻译自askubuntu.com,详情可以点击链接查看。本文大多采用意译,译者水平有限,如有错误,还请指正。
问题
我的操作系统是ubuntu 16.04
,从ubuntu
的库中安装apache2
的时候,在输入如下命令之后:
sudo systemctl enable apache2
命令行提示如下:
apache2.service is not a native service, redirecting to
systemd-sysv-install Executing /lib/systemd/systemd-sysv-install
enable apache2
我也尝试重新安装apache2,但是还会提示相同的错误。
在搜索过相关问题之后,我发现这个提示的出现是因为配置文件有句法错误。但是我并没有相关的错误,有可能是因为我刚刚才安装上apache2,还没有配置文件。
解答1
这个错误并没有反映出apache
本身的任何问题,但是它告诉您,即使您使用Systemd
命令来启用服务,它实际上还是在调用SysV init
样式的脚本来启动程序。如果apache
运行正常,您可以安全地忽略此错误。
解答2
这不是一个错误,而是Ubuntu 16.04
仍然使用SysV init
样式的脚本来启动Apache
,Systemd
只是又包装了一下。
从/lib/systemd/systemd-sysv-install
目录下的文件可见:
This script is called by “systemctl enable/disable” when the given unit is a SysV init.d script. It needs to call the distribution’s mechanism for enabling/disabling those, such as chkconfig, update-rc.d, or similar.