[syslog-ng] I have a question

Roberto Nibali ratz at drugphish.ch
Tue Sep 20 10:36:21 CEST 2005


Dear John,

> I used syslog-ng_1.6.x , there has a startup script (maybe init.d.RedHat-7.3 )
> in install directory . So I can start or stop it very easy . But in syslog-ng_1.9.5 ,
> I haven't found the startup script , there is not convenience. I used logrotate.d
>  separate log files . when the logrotate.d finished , it will restart the syslog-ng
> service . if there haven't startup script , I must added a script in logrotate.conf :

Why not use the syslog-ng-1.6.x startup script?

> postrotate
> /usr/bin/killall -HUP /usr/local/syslog-ng/sbin/syslog-ng 2> /dev/null || true
> endscript  
> 
> above script always killed the syslog-ng process and not startup syslog-ng process .I don't know the reason.

This indeed is a bit strange as -HUP should not kill the process per se 
with regard to syslog-ng. I've just tested this and and if I do it by 
hand the syslog-ng process is indeed killed by this, although not all 
the time. Some short time digging reveiled following:

webphish:~ # ulimit -c unlimited
webphish:~ # /sbin/syslog-ng-1.9.5 -v -d -d -F

[in another terminal send a /usr/bin/killall -HUP /sbin/syslog-ng-1.9.5]

Segmentation fault (core dumped)
webphish:~ # gdb -q /sbin/syslog-ng-1.9.5 ./core
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Core was generated by `/sbin/syslog-ng-1.9.5 -v -d -d -F'.
Program terminated with signal 11, Segmentation fault.
#0  0x08065009 in g_string_truncate ()
(gdb) bt
#0  0x08065009 in g_string_truncate ()
#1  0x08065fbc in g_string_assign ()
#2  0x0804f85e in log_source_group_queue (s=0x8116988, msg=0x810e290,
     path_flags=0) at sgroup.c:110
#3  0x0804a878 in log_pipe_forward_msg (self=0x0, msg=0x81113d8, 
path_flags=0)
     at logpipe.h:72
#4  0x080533ea in log_source_queue (s=0x8116540, msg=0x81113d8, 
path_flags=0)
     at logpipe.h:72
#5  0x08052dc3 in afinter_source_dispatch_msg (pipe=0x0, msg=0x81113d8)
     at logpipe.h:72
#6  0x08052df3 in afinter_source_dispatch (source=0x8116568,
     callback=0x8052db0 <afinter_source_dispatch_msg>, user_data=0x8116540)
     at afinter.c:51
#7  0x08058ef8 in g_main_context_dispatch ()
#8  0x0805b0e7 in g_main_context_iterate ()
#9  0x0805b1ba in g_main_context_iteration ()
#10 0x0804854f in main_loop_run (cfg=0x81163c0) at main.c:142
#11 0x0804882a in main (argc=5, argv=0xbffff344) at main.c:387
(gdb) q
webphish:~ #

No time to further dig into this yet.

> when i used syslog-ng_1.6.x , I can use a easy script instead of above script :
> 
> postrotate
> service syslog-ng restart
> endscript

Check out the contrib directory of the syslog-ng-1.6.x source tree and 
there you'll find all the startup scripts needed. They should also work 
for the 1.9.x drop of syslog-ng.

Bazsi, do you think that copying the contrib directory from 1.6.x to 
1.9.x would make sense?

> Could you give me a suggestion  ! thanks .

Di shui chuan shi ;) and best regards,
Roberto Nibali, ratz
-- 
echo 
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc


More information about the syslog-ng mailing list