Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 753 of 806  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Version Subject
  480   Thu Feb 19 09:38:13 2004 Angy Stefan Rittstefan.ritt@psi.chBug reportLinux2.5.0Re: elogd does not exit on SIGTERM
Noee. Here it works immediately.

Can you try with a fresh server from the distribution, with the example 
elogd.cfg, to see if there is any difference?

The killing is handled in the funciton ctrlc_handler(), which sets _abort = 
TRUE. This  is checked in line 16195, just after the select(), and the main 
loop is exited. The select finishes after one second, although I believe 
that the kill signal also terminates the select prematurely. The kill 
command and a Ctrl-C keystroke should work the same way, they both generate 
a SIGTERM or SIGINT signal.
  479   Wed Feb 18 16:54:27 2004 Angy Heiko Scheith.scheit@mpi-hd.mpg.deBug reportLinux2.5.0elogd does not exit on SIGTERM
When trying to stop elogd processes with the kill command
elogd exits only after access to the logbook.

It should exit immediately, maybe after some cleanup.
  478   Mon Feb 16 17:18:39 2004 Question Heiko Scheith.scheit@mpi-hd.mpg.de Linux2.5.0Re: -W -Wall options (using gcc)
> > Have a look at the gcc info pages:
> > 
> > $ info gcc "invoking gcc" "warning options"
> 
> Sure, I'm not stupid! 

  Sorry, didn't mean to offend you.

> I looked for ~10 minutes how to turn off the remaining 
> warnings, but I could not find it. The code is now correct, like I do want the 
> "%y" format specifier in the strftime() function, but the warning is wrong.

  One way to remove the warnings would be to use "%Y" in a separate strftime() call
  and then taking only the last two digits (characters) of that string.

  Something like:
old:
   strftime(str, sizeof(str), "%A, %d-%b-%y %H:%M:%S GMT", gmt);

new:
   strftime(str, sizeof(str), "%A, %d-%b-XX %H:%M:%S GMT", gmt);
   strftime(year, sizeof(year), "%Y", gmt);
   i=strstr(str,"XX"); /* find position of XX */
   if ( i+1 < sizeof(str) ) {
     str[i]  =year[3];
     str[i+1]=year[4];
   } else ...

  Somewhat cumbersome, but should work.  Maybe consider using the four 
  digit year directly, where possible.

  Gruss, Heiko
  477   Mon Feb 16 16:47:55 2004 Question Stefan Rittstefan.ritt@psi.ch Linux2.5.0Re: -W -Wall options (using gcc)
> Have a look at the gcc info pages:
> 
> $ info gcc "invoking gcc" "warning options"

Sure, I'm not stupid! I looked for ~10 minutes how to turn off the remaining 
warnings, but I could not find it. The code is now correct, like I do want the 
"%y" format specifier in the strftime() function, but the warning is wrong. The 
closest I came to was 

-W -Wall -Wno-format

which removes ther warning in strftime(), but I do want this warning, since it 
helps in many other printf() statements.
  476   Mon Feb 16 16:40:50 2004 Question Heiko Scheith.scheit@mpi-hd.mpg.de Linux2.5.0Re: -W -Wall options (using gcc)
> So I fixed all compiler generated warnigns except these:
> 
> [midas@pc2075 ~/elog]$ gcc -g -O -W -Wall -o elogd src/elogd.c
> src/elogd.c: In function `set_cookie':
> src/elogd.c:4675: warning: `%y' yields only last 2 digits of year
> src/elogd.c: In function `send_file_direct':
> src/elogd.c:5483: warning: `%y' yields only last 2 digits of year
> src/elogd.c: In function `show_elog_list':
> src/elogd.c:11938: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c:11957: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c:11979: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c:11987: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c: In function `ctrlc_handler':
> src/elogd.c:15864: warning: empty body in an if-statement
> src/elogd.c: In function `hup_handler':
> src/elogd.c:15870: warning: empty body in an if-statement
> 
> Do you know how to disable these warnings or any other workaround? I would 
> like to compile without any remaining warnings.


Have a look at the gcc info pages:

$ info gcc "invoking gcc" "warning options"
  475   Mon Feb 16 16:07:34 2004 Question Stefan Rittstefan.ritt@psi.ch Linux2.5.0Re: -W -Wall options (using gcc)
So I fixed all compiler generated warnigns except these:

[midas@pc2075 ~/elog]$ gcc -g -O -W -Wall -o elogd src/elogd.c
src/elogd.c: In function `set_cookie':
src/elogd.c:4675: warning: `%y' yields only last 2 digits of year
src/elogd.c: In function `send_file_direct':
src/elogd.c:5483: warning: `%y' yields only last 2 digits of year
src/elogd.c: In function `show_elog_list':
src/elogd.c:11938: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c:11957: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c:11979: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c:11987: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c: In function `ctrlc_handler':
src/elogd.c:15864: warning: empty body in an if-statement
src/elogd.c: In function `hup_handler':
src/elogd.c:15870: warning: empty body in an if-statement

Do you know how to disable these warnings or any other workaround? I would 
like to compile without any remaining warnings.
  474   Fri Feb 13 21:59:44 2004 Reply Stefan Rittstefan.ritt@psi.ch Linux2.5.0Re: elog (not elogd) submit does not work anymore
Oops! I 're-used' the '-s' flag for email suppression, so it was actually 
double used. I changed the email supprssion flag to '-p', so '-s' should 
work again for specifying subdirectories.
  473   Fri Feb 13 21:52:48 2004 Reply Stefan Rittstefan.ritt@psi.ch Linux2.5.0Re: -W -Wall options (using gcc)
Thanks, I did so.
ELOG V3.1.5-3fb85fa6