我已经通过从 git 克隆和安装 nginx 在我的 ubuntu 服务器上编译了 nginx(1.13.6)。我想用附加模块重新编译它。当我尝试使用以下命令删除 nginx 时:
sudo service nginx stop
sudo rm -f -R /usr/local/nginx && rm -f /usr/local/sbin/nginx
输入后我得到以下输出sudo service nginx status
,表明 nginx 尚未完全删除。
● nginx.service
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
systemd[1]: [/lib/systemd/system/nginx.service:6] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: [/lib/systemd/system/nginx.service:6] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: [/lib/systemd/system/nginx.service:6] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: [/lib/systemd/system/nginx.service:6] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: [/lib/systemd/system/nginx.service:6] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: [/lib/systemd/system/nginx.service:19] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: nginx.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
systemd[1]: [/lib/systemd/system/nginx.service:6] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: [/lib/systemd/system/nginx.service:19] Unknown lvalue 'KillStop' in section 'Service'
systemd[1]: nginx.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
我怎样才能彻底删除 nginx 并从头开始重新编译它?
答案1
您已删除 nginx。您尚未删除 systemd 单元文件,也未将其停用。
要停用服务,请运行systemctl disable nginx
。要删除单元文件,请删除文件/lib/systemd/system/nginx.service
。