Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212213 - app-admin/tenshi won't stop via initscript
Summary: app-admin/tenshi won't stop via initscript
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Markus Ullmann (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-03 17:38 UTC by Mike Hammill
Modified: 2008-03-17 16:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/tenshi stop --debug (mike_tenshi_stop3,37.62 KB, text/plain)
2008-03-03 17:43 UTC, Mike Hammill
Details
proposed fix (tenshi-0.9.1-fix-tail_pids-array-length.diff,353 bytes, patch)
2008-03-04 22:15 UTC, Adam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hammill 2008-03-03 17:38:13 UTC
app-admin/tenshi-0.7 and 0.9.1 (latest stable and ~x86) both will not stop for me with /etc/init.d/tenshi stop.  The closest bug match I could find is bug #85395 (CANTFIX) from 2005, but I can find no reason to suspect an smtp timeout problem in my case.  Furthermore, attempting what the author of that bug did, running in foreground, I found no problem killing tenshi with ctrl-c.  On the other hand, I admit I am not an expert with all the issues involved.  I checked the forums and found no relevant discussion about this problem with tenshi.


Reproducible: Always

Steps to Reproduce:
1. /etc/init.d/tenshi start
2. /etc/init.d/tenshi stop
3.

Actual Results:  
1. [ok]
2. [!!]

Expected Results:  
1. [ok]
2. [ok]

I will attach a --debug version of the init.d/stop.

Also, when I run:
/usr/bin/perl /usr/sbin/tenshi -d 2 -f -c /etc/tenshi/tenshi.conf -P /var/lib/tenshi/tenshi.pid
and do ctrl-c, I get simply:
[MAIN]  trapped INT signal!
[MAIN]  trapped CHLD signal!
[ERROR] Child died. Bailing out
Killed
 at /usr/sbin/tenshi line 908.

(latest instable version, in the above case).  No tenshi processes (tenshi or tail are left around.

Adding a signal to /etc/init.d/tenshi as follows:
start-stop-daemon --stop --signal SIGKILL --quiet --pidfile /var/lib/tenshi/tenshi.pid

of course results in and [ok], but tenshi's child (tail) process is left running and I would assume, tenshi's buffers don't get flushed (which would be very bad).

I tried killing /usr/bin/perl /usr/sbin/tenshi -c /etc/tenshi/tenshi.conf -P /var/lib/tenshi/tenshi.pid

manually with TERM, INT, USR2, HUP, but nothing seems to stop it.  Strange since running it in debug more and the foreground, a simple ctrl-c kills it.
Comment 1 Mike Hammill 2008-03-03 17:43:05 UTC
Created attachment 145224 [details]
/etc/init.d/tenshi stop --debug 

Attempt at stopping tenshi.  BTW, I have checked the contents and access rights to the pid file.  All that seems ok.
Comment 2 Adam James 2008-03-04 22:15:18 UTC
Created attachment 145307 [details, diff]
proposed fix

This trivial patch should fix it. I presume you only have a single child tail process as this bug shouldn't have affected you otherwise.
Comment 3 Adam James 2008-03-04 22:44:36 UTC
I just spoke to upstream and this will be fixed for the next release.
Comment 4 Mike Hammill 2008-03-05 10:07:33 UTC
(In reply to comment #2)
Trivial or not, I much appreciate the fix and it works for me! (see below)  You are correct that I have only a single child (tail) process with tenshi.  I would expect that is what most folks running Gentoo would have since the tail with Gentoo seems to not need tenshi's "tail_multiple on" option.  In other words, I would expect the fix to help others than just me.

I hope you can find a maintainer for tenshi.  It's one of the best log analysis tools from my point of view.  Also, I got the impression that Gentoo uses it internally for their servers.  If I knew more about Perl (and were otherwise qualified :-), I would volunteer.

Thanks!

fluke Tenshi # /etc/init.d/tenshi start
 * Starting tenshi ...                                                                                                                                                [ ok ]
fluke Tenshi # ps -ef | grep tenshi
tenshi   29371     1  0 10:57 ?        00:00:00 /usr/bin/perl /usr/sbin/tenshi -c /etc/tenshi/tenshi.conf -P /var/lib/tenshi/tenshi.pid
tenshi   29372 29371  0 10:57 ?        00:00:00 /usr/bin/tail -q --follow=name --retry -n 0 /var/log/messages /var/log/remote.d/gannet.log /var/log/remote.d/tjasse.log /var/log/remote.d/serendipity.log
root     29381 27197  0 10:57 pts/4    00:00:00 grep --colour=auto tenshi
fluke Tenshi # /etc/init.d/tenshi stop
 * Stopping tenshi ...                                                                                                                                                [ ok ]
fluke Tenshi # ps -ef | grep tenshi
root     29417 27197  0 10:58 pts/4    00:00:00 grep --colour=auto tenshi
fluke Tenshi # 

/Mike
PS  I leave this bug open only because I don't know if you want it closed if you are looking for a maintainer.  Feel free to close otherwise.
Comment 5 Adam James 2008-03-17 16:16:08 UTC
Thanks to Markus, I am now proxy maintainer for tenshi. This bug is fixed in tenshi-0.9.1-r1 which will hit the tree today.
Comment 6 Markus Ullmann (RETIRED) gentoo-dev 2008-03-17 16:33:55 UTC
Fixed in CVS :)