从 hudson 开始 Glassfish

发布于 2024-12-03 06:53:03 字数 610 浏览 3 评论 0原文

我使用 Hudson 进行 CI 和 Glassfish 服务器的重启。它很方便,因为不需要 ssh 访问。

使用 shell 命令的简单 hudson 作业曾经可以工作:

 cd /opt/glassfish3/glassfish/bin;
./asadmin start-domain domain1;

但是从某个时候(不记得什么时候)这工作起来非常奇怪:作业一直挂起,直到启动过程完成并退出,日志中没有异常:

[#|2011-09-07T02:36:06.280+0400|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=线程- 1;|GlassFish Server开源版3.1(43)启动时间:Felix(3,022ms),启动服务(38,884 毫秒),总计(41,906 毫秒)|#]

但是GF实际上并没有启动!系统中没有这个进程!所以我必须从 ssh 控制台手动执行相同的操作...似乎 hudson 作业完成后 GF 的过程就完成了。

谢谢,安东

I use Hudson for both CI and restart of Glassfish server. It's convenient as doesn't require ssh access.

The simple hudson job with shell command used to work:

 cd /opt/glassfish3/glassfish/bin;
./asadmin start-domain domain1;

But from some time (don't remember when) this works very strange: the job is hanging until the start procedure is finished and exits, there are no exceptions in log:

[#|2011-09-07T02:36:06.280+0400|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=Thread-1;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (3,022ms), startup services(38,884ms), total(41,906ms)|#]

But the GF in fact isn't started! There is no such process in the system! So I have to do the same manually from ssh console... Seems the process for GF is finished as soon as the hudson job finishes.

Thanks, Anton

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

偷得浮生 2024-12-10 06:53:03

也许 Hudson 的行为因分叉进程而改变。
您还可以以嵌入模式(进程内)启动 GlassFish:http://embedded-glassfish。 java.net/nonav/apidocs/ , http://weblogs.java.net/blog/bhavanishankar/archive/2011/03/02/quick-introduction-embeddability-glassfish-open-source-edition-31
或使用 :

java -jar glassfish/modules/glassfish.jar

(请注意,如果仅配置了一个域,则可以省略域名)。

Maybe Hudson's behavior changed wrt forking a process.
You can also start GlassFish in embedded mode (in-process): http://embedded-glassfish.java.net/nonav/apidocs/ , http://weblogs.java.net/blog/bhavanishankar/archive/2011/03/02/quick-introduction-embeddability-glassfish-open-source-edition-31
or using :

java -jar glassfish/modules/glassfish.jar

(note you can omit the domain name, if there's only one domain configured).

葬心 2024-12-10 06:53:03

找到了答案。还有其他一些方法,但最简单的一种非常好奇:)。只需使用环境变量:

BUILD_ID=dontKillMe

仅此而已!这告诉 Jenkins 不要完成由该作业启动的进程。
作为设置这些变量的插件,我使用 Jenkins 环境注入插件

希望这对其他人有帮助。

Found the answer. There are some other ways, but the easiest one is very curios :). Just use the env variable:

BUILD_ID=dontKillMe

and that's all! This tells Jenkins not to finish processes, launched by this job.
As the plugin for setting these variables I use Jenkins Environment Inject Plug-in

Hope this will help anyone else.

相权↑美人 2024-12-10 06:53:03

解决问题的另一种方法是在 jenkins 的开头添加以下行。

java -Dhudson.util.ProcessTreeKiller.disable=true -jar jenkins.war

another way to solve the problem is just add the below lines at the start of jenkins.

java -Dhudson.util.ProcessTreeKiller.disable=true -jar jenkins.war

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文