java 如何从命令提示符或管理控制台停止 Hybris 服务器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29227140/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to Stop Hybris server from command prompt or Admin console
提问by user2492144
I want to add a new extension and for that I need to stop hybris server first, but I am unable to figure out how exactly I should STOP the server: through command line or by admin Console?
I cannot type any command as my server is running.
I also started the server by using hybrisserver.bat
我想添加一个新扩展,为此我需要先停止 hybris 服务器,但我无法弄清楚我应该如何停止服务器:通过命令行还是通过管理控制台?
由于我的服务器正在运行,我无法键入任何命令。
我还使用 hybrisserver.bat 启动了服务器
采纳答案by shuriquen
Use this command /bin/platform/hybrisserver.sh stop
使用此命令 /bin/platform/hybrisserver.sh 停止
That will stop the server.
这将停止服务器。
回答by Dirder
just push ctrl + c in the command line window and the server is shut down properly
只需在命令行窗口中按 ctrl + c 即可正常关闭服务器
回答by beta
As a small side note, if you'd like to stop a hybris server through the admin console, you could always go to Console > Scripting Languages > Edit Statementand execute System.exit(0);
附带说明一下,如果您想通过管理控制台停止 hybris 服务器,您可以随时转到Console > Scripting Languages > Edit Statement并执行System.exit(0);
hybris has got all the necessary runtime shutdown hooks to do a graceful (as if you did CTRL + C
).
hybris 拥有所有必要的运行时关闭钩子来做一个优雅的(就像你一样CTRL + C
)。
In theory it's also possible to restart the hybris system internally by executing:
理论上,也可以通过执行以下命令在内部重新启动 hybris 系统:
import de.hybris.platform.core.Registry;
Registry.destroyAndForceStartup();
By default, there's a restriction to forbid doing so using groovy scripts, though.
但是,默认情况下,使用 groovy 脚本禁止这样做是有限制的。
回答by Przemys?aw Kaczmarczyk
Sometimes it happen that the hybrisserver is runned on another console and even after hybrisserrver.sh stop
some processes are still running. And you will receive message like:
有时,hybrisserver 会在另一个控制台上运行,甚至在hybrisserrver.sh stop
某些进程仍在运行之后。您将收到如下消息:
INFO: Illegal access: this web application instance has been stopped already
My solution is (for linux based systems):
我的解决方案是(对于基于 linux 的系统):
lsof | grep hybris
To get the processes runned from "hybris" directory(change on you need) and then kill the listed processes with:
要从“hybris”目录运行进程(根据需要进行更改),然后使用以下命令终止列出的进程:
kill -15 <PROCESS_ID>
PS. (This solution require the root privileges)
附注。(此方案需要root权限)