Need to parametrize terminate signal

7 views
Skip to first unread message

and...@gmail.com

unread,
Aug 17, 2016, 9:21:53 AM8/17/16
to Ubic
Hello!

We are using ubic to run java application. It creates few child processes.
When app gets termination signal, it should perform some termination procedures and only then stop child processes.
But in ubic code there is:

kill -15 => $child;

-15 means to send term signal not to single process but to process group. So, on stopping my app child processes are stopped immediately too.

For some reasons I don't want to detach child processes or override sigterm processing in it.

Is there any other way to send term signal to main app process only?

Vyacheslav Matyuhin

unread,
Aug 17, 2016, 9:31:06 AM8/17/16
to ubic...@googlegroups.com
Hmm.
I see how this can be a problem.

As you discovered in the code, there is no parameter to tweak it, besides rewriting your service code from scratch without using Ubic::Daemon. That would be painful.

I guess the best solution is to patch Ubic::Daemon:
* add send_term_to_children boolean option to Ubic::Daemon::start_daemon
* accept send_term_to_children in Ubic::Service::SimpleDaemon constructor and pass it down to start_daemon

Would you be willing to send a pull request implementing this?
(Unfortunately, I moved on from perl development, and while I’m willing to small accept patches, I don’t have much time to implement new features myself.)

-- 
Vyacheslav Matyuhin

--
You received this message because you are subscribed to the Google Groups "Ubic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ubic-perl+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

and...@gmail.com

unread,
Aug 18, 2016, 9:54:53 AM8/18/16
to Ubic
I've implemented it some other way. I created parameter containing signal value with default -15.
https://github.com/berekuk/Ubic/pull/81

среда, 17 августа 2016 г., 16:31:06 UTC+3 пользователь Vyacheslav Matyukhin написал:
Reply all
Reply to author
Forward
0 new messages