sudo ./jetty停止或开始失败

问题描述 投票:0回答:1

我们的linux服务器上的码头没有作为服务安装,因为我们在不同的端口上有多个jetty服务器。我们使用command./jetty.sh stop./jetty.sh start停止并启动码头。

但是,当我向命令添加sudo时,服务器永远不会停止/启动成功。当我运行sudo ./jetty.sh stop时,它显示

Stopping Jetty: start-stop-daemon: warning: failed to kill 18772: No such process
1 pids were not killed
No process in pidfile '/var/run/jetty.pid' found running; none killed.

并且服务器没有停止。

当我运行sudo ./jetty.sh start时,它显示

Starting Jetty: FAILED Tue Apr 23 23:07:15 CST 2019

怎么会发生这种情况?从我的理解。使用sudo可以为您提供更多的权限和特权来运行命令。如果你可以在没有sudo的情况下成功执行,那么命令永远不会因sudo而失败,因为它只授予超级用户权限。

linux jetty sudo pid
1个回答
1
投票

作为用户,它使用$HOME

它以root身份使用系统路径。

你得到的错误..

Stopping Jetty: start-stop-daemon: warning: failed to kill 18772: No such process
1 pids were not killed
No process in pidfile '/var/run/jetty.pid' found running; none killed.

...意味着有一个糟糕的pid文件围绕着一个不再存在的进程。

简而言之,如果您是root(服务)与用户(仅仅是应用程序),则处理是不同的。

© www.soinside.com 2019 - 2024. All rights reserved.