Xymon Mailing List Archive search

Hobbit 4.02 and Patches..

9 messages in this thread

list Bob Gordon · Tue, 19 Apr 2005 16:05:29 -0700 ·
Hello -

I have been seeing several patches floating around for 4.02 and am not
sure of the order of application.   What order are they applied in and
are they all located off the demo site?

Thanks -

-- 
--==[ Bob Gordon ]==--
list Henrik Størner · Wed, 20 Apr 2005 07:42:10 +0200 ·
quoted from Bob Gordon
On Tue, Apr 19, 2005 at 04:05:29PM -0700, Bob Gordon wrote:
I have been seeing several patches floating around for 4.02 and am not
sure of the order of application.   What order are they applied in and
are they all located off the demo site?
There are 3 patches available from the "Demo Site -> Downloads"
directory:

hobbit-4.0.2-acknowledge.patch : Patch for the broken acknowledgment
handling in Hobbit 4.0.2 (ack's are not working)

hobbit-4.0.2-setup.patch : Patch for a filedescriptor leak during 
the "make install" process. If you installed Hobbit successfully, you
do not need this one.

hobbit-4.0.2-alertscript.patch : Patch for the HTML link to the status
not being included in the default alert message for scripts.

You can install these in any order, I think. The only critical one is
the first.


Finally, there is a patch around that replaces the perl-based
enable/disable script (maint.pl) with a native Hobbit tool. This is
somewhat more "experimental" since it hasn't really had much testing,
although I do plan on deploying it to my production system later
today. Apply this last - You'll find it at
http://www.hswn.dk/beta/maintenance-feature-v2.patch


Regards,
Henrik
list Lars Ebeling · Wed, 20 Apr 2005 07:49:05 +0200 (CEST) ·
quoted from Henrik Størner

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
Finally, there is a patch around that replaces the perl-based
enable/disable script (maint.pl) with a native Hobbit tool. This is
somewhat more "experimental" since it hasn't really had much testing,
although I do plan on deploying it to my production system later
today. Apply this last - You'll find it at
http://www.hswn.dk/beta/maintenance-feature-v2.patch


Does this mean that I should forget that this doesn't work for me? I'm reinstalling hobbit again and again. As I wrote before when I shut down Apache the tests, that I wanted to disable hours ago, suddenly are disabled when I start Apache again.

Regards

Lars


Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Henrik Størner · Wed, 20 Apr 2005 08:01:20 +0200 ·
quoted from Lars Ebeling
On Wed, Apr 20, 2005 at 07:49:05AM +0200, lars ebeling wrote:
Does this mean that I should forget that this doesn't work for me?
 I'm reinstalling hobbit again and again. As I wrote before when I
 shut down Apache the tests, that I wanted to disable hours ago,
 suddenly are disabled when I start Apache again.
I've seen your report about this, but haven't had much time to follow
up on it. 

When exactly does the system "hang" as you describe - when you click
the "Apply" button on the disable form ? Or before the form ever
appears ?

Does it hang also if you use the disable function from the "info"
column page ? 

If you do a "ps" listing of the processes spawned by Apache, is there
a "hobbit-enadis" CGI running when this happens ? If there is, could
you add "--debug" to the hobbit-enadis.cgi command in
~/cgi-secure/hobbit-enadis.sh and let me know what that reports when
you hit the "Apply" button ? 

Also, you can try killing the hobbit-enadis process when it hangs with
a "kill -6 PID" - that should make it core-dump, although I'm not
quite sure where this core file ends up since it runs as a CGI
script. You may have to add a "cd /tmp" in the hobbit-enadis.sh CGI
wrapper to get it to core-dump in /tmp. If you find such a dump, it
would be interesting if you could get the stacktrace:

    $ gdb hobbit/server/bin/hobbit-enadis.cgi /tmp/core
    ...
    gdb> bt


Regards,
Henrik
list Lars Ebeling · Wed, 20 Apr 2005 09:24:59 +0200 (CEST) ·
quoted from Henrik Størner

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote: 
I've seen your report about this, but haven't had much time to follow
up on it. 
When exactly does the system "hang" as you describe - when you click
the "Apply" button on the disable form ? Or before the form ever
appears ?


When I click on Apply or OK on password form
quoted from Henrik Størner


Does it hang also if you use the disable function from the "info"
column page ? 

Only from info column page
quoted from Henrik Størner


If you do a "ps" listing of the processes spawned by Apache, is there
a "hobbit-enadis" CGI running when this happens ? If there is, could
you add "--debug" to the hobbit-enadis.cgi command in
~/cgi-secure/hobbit-enadis.sh and let me know what that reports when
you hit the "Apply" button ? 

Nothing, only hangs!
quoted from Henrik Størner


Also, you can try killing the hobbit-enadis process when it hangs with
a "kill -6 PID" - that should make it core-dump, although I'm not
quite sure where this core file ends up since it runs as a CGI
script. You may have to add a "cd /tmp" in the hobbit-enadis.sh CGI
wrapper to get it to core-dump in /tmp. If you find such a dump, it
would be interesting if you could get the stacktrace:

Core was generated by éhobbit-enadis'.                                         Program terminated with signal 6, Aborted.                                                                                                                    warning: The shared libraries were not privately mapped; setting a             breakpoint in a shared library will not work until you rerun the program.                                                                                     Reading symbols from /usr/local/lib/libpcre.sl.0...done.                       Reading symbols from /usr/local/lib/libgcc_s.sl...done.                        Reading symbols from /usr/lib/libnsl.1...done.                                 Reading symbols from /usr/lib/libxti.2...done.                                 Reading symbols from /usr/lib/libc.2...done.                                   Reading symbols from /usr/lib/libdld.2...done.                                 #0  0xc02003e0 in _read_sys () from /usr/lib/libc.2                            (gdb) bt                                                                       #0  0xc02003e0 in _read_sys () from /usr/lib/libc.2                            #1  0xc020afdc in read () from /usr/lib/libc.2                                 #2  0xc01edf64 in _filbuf () from /usr/lib/libc.2                              #3  0xc01eda7c in __fgets_unlocked () from /usr/lib/libc.2                     #4  0xc01edc74 in fgets () from /usr/lib/libc.2                                #5  0x00003364 in parse_post () at hobbit-enadis.c:155                         #6  0x00003a04 in main (argc=2, argv=0x7f7e0578) at hobbit-enadis.c:231        (gdb)                                                                          
quoted from Lars Ebeling

Regards

Lars


Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Henrik Størner · Wed, 20 Apr 2005 14:58:53 +0200 ·
Hi Lars,

[the hobbit-enadis CGI hangs]

On Wed, Apr 20, 2005 at 09:24:59AM +0200, lars ebeling wrote:
(gdb) bt                                                                       
quoted from Lars Ebeling
#4  0xc01edc74 in fgets () from /usr/lib/libc.2                                
#5  0x00003364 in parse_post () at hobbit-enadis.c:155                         
#6  0x00003a04 in main (argc=2, argv=0x7f7e0578) at hobbit-enadis.c:231        
I don't know if it's just you or the HP-UX environment you're using,
but you have an annoying habit of spotting bugs that don't trigger
under the circumstances that I have. This bug is obvious, once I
actually read the CGI specification of how to handle POST requests.

Could you try the attached patch on top of the maintenance-feature-v2
patch and let me know if it solves the problem for you ?


Thanks,

Henrik
-------------- next part --------------
--- hobbitd/hobbit-enadis.c	2005/04/18 12:31:06	1.6
+++ hobbitd/hobbit-enadis.c	2005/04/20 12:45:17
@@ -50,13 +50,19 @@
 
 void parse_post(void)
 {
-	char l[4096];
+	char l[8192];
         char *token;
 	struct tm schedtm;
+	int lefttoread = atoi(xgetenv("CONTENT_LENGTH"));
 
 	memset(&schedtm, 0, sizeof(schedtm));
 
-	while (fgets(l, sizeof(l), stdin)) {
+	while (lefttoread > 0) {
+		if (fgets(l, sizeof(l), stdin) == NULL) {
+			errormsg("Error reading POST data\n");
+		}
+		lefttoread -= strlen(l);
• l[sizeof(l)-1] = '\0';
 		token = strtok(l, "&");
list Lars Ebeling · Wed, 20 Apr 2005 15:23:35 +0200 (CEST) ·
quoted from Henrik Størner

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:

Could you try the attached patch on top of the maintenance-feature-v2
patch and let me know if it solves the problem for you ?


Sorry Henrik,

but 
Reading symbols from /usr/local/lib/libpcre.sl.0...done.                     Reading symbols from /usr/local/lib/libgcc_s.sl...done.                      Reading symbols from /usr/lib/libnsl.1...done.                               Reading symbols from /usr/lib/libxti.2...done.                               Reading symbols from /usr/lib/libc.2...done.                                 Reading symbols from /usr/lib/libdld.2...done.                               #0  0xc02003e0 in _read_sys () from /usr/lib/libc.2                          (gdb) bt                                                                     #0  0xc02003e0 in _read_sys () from /usr/lib/libc.2                          #1  0xc020afdc in read () from /usr/lib/libc.2                               #2  0xc01edf64 in _filbuf () from /usr/lib/libc.2                            #3  0xc01eda7c in __fgets_unlocked () from /usr/lib/libc.2                   #4  0xc01edc74 in fgets () from /usr/lib/libc.2                              #5  0x00002eb4 in parse_post () at hobbit-enadis.c:61                        #6  0x00003abc in main (argc=2, argv=0x7f7e0570) at hobbit-enadis.c:237      (gdb)                                                                        
quoted from Lars Ebeling
Regards

Lars

 
Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Lars Ebeling · Wed, 20 Apr 2005 17:15:33 +0200 (CEST) ·
quoted from Henrik Størner

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
I don't know if it's just you or the HP-UX environment you're using,?

I don't think it's me, or at least don't hope so. I am not a pro on porting systems. I am just doing this as a hobby, since I lost my job and "took" 2 obsolete HP-UX servers with me home. I was running BB at work and bbgen (could it have been 2.1.15?).

But I never felt very well with the BTF-license. But we were using BB internally at the IT-department for internal systems. 
I very much appreciate Hobbit and hopefully it could be more than a hobby. 
I have been working with computers in 30 years. Started to learn Algol on a DataSaab D21. Then COBOL on IBM 360/65. (Also learnt PL/1, APL, Assembler and Databus)  All programs were on punched cards. 
I would very much like to learn C but when I read void I think this I have to avoid.

Well that was a little bit about me.

Regards

Lars

PS do you want to know about my computersystem just ask
quoted from Lars Ebeling


Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Henrik Størner · Thu, 21 Apr 2005 11:15:15 +0200 ·
quoted from Lars Ebeling
On Wed, Apr 20, 2005 at 05:15:33PM +0200, lars ebeling wrote:

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
I don't know if it's just you or the HP-UX environment you're using,?

I don't think it's me, or at least don't hope so.
I was just joking. I'm actually quite happy that you report these
bugs, because for some reason your setup exercises all of the
corner-cases that Hobbit should handle OK, but where it is easy to
implement something that works "most of the time". But "most of the
time" just isn't good enough for a critical system such as Hobbit - 
monitoring has to work *all* of the time.

So your testing of Hobbit really is useful as quality control.
quoted from Lars Ebeling

I have been working with computers in 30 years. Started to learn
Algol on a DataSaab D21. Then COBOL on IBM 360/65. (Also learnt
PL/1, APL, Assembler and Databus) All programs were on punched
cards.
Punch cards ... I just missed those, my class at the university was
the first one to use 8" floppy disks instead of punch-cards.


Regards,
Henrik