[tac_plus] running tac_plus in the foreground
John Payne
john at sackheads.org
Tue Oct 2 15:07:37 UTC 2007
In my work environment, we have our own process management setup that
manages whether applications start, a single place for them to stop,
groups processes together for start/stop/restart, etc.
The gotcha is that the applications need to run in the foreground
(the process manager backgrounds itself, but it uses the
application's vty to determine if it's still running).
The only option I found on tac_plus was '-g' but obviously, I can't
run in production single threaded.
I tried this quick patch:
*** tac_plus.c.OLD Tue Aug 15 20:09:36 2006
--- tac_plus.c Fri Sep 28 15:30:43 2007
***************
*** 44 ****
--- 45 ----
+ int foreground = 0; /* don't do the initial fork to
background */
***************
*** 231 ****
--- 233 ----
+ foreground = 0; /* send to background*/
***************
*** 259 ****
! while ((c = getopt(argc, argv, "B:C:d:hiPp:tgvsLl:w:u:")) != EOF)
--- 261 ----
! while ((c = getopt(argc, argv, "B:C:d:hiPp:tgvsfLl:w:u:")) != EOF)
***************
*** 281 ****
--- 284,286 ----
+ case 'f': /* single threaded */
+ foreground++;
+ break;
***************
*** 377 ****
! if (!single) {
--- 382 ----
! if (!single && !foreground) {
which _seemed_ to do the right thing, but now I'm left with lots of
defunct tac_plus processes.
I suspect I missed something with the signal handling, but I could
use some guidance here :)
Thanks
John
More information about the tac_plus
mailing list