Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16308 - bad interaction between vcron, syslog-ng and logrotate resulting in vcron not restarting
Summary: bad interaction between vcron, syslog-ng and logrotate resulting in vcron not...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Aron Griffis (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 7144
  Show dependency tree
 
Reported: 2003-02-24 15:02 UTC by Mr. Bones. (RETIRED)
Modified: 2003-02-27 23:49 UTC (History)
0 users

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


Attachments
patch to add opts and reload function to /etc/init.d/syslog-ng (syslog-ng-reload.patch,689 bytes, patch)
2003-02-24 15:35 UTC, Mr. Bones. (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mr. Bones. (RETIRED) gentoo-dev 2003-02-24 15:02:23 UTC
In the default merge of vcron, syslog-ng and logrotate the syslog-ng
service is restarted when the logrotate cron.daily job is run in accordance
with the /etc/logrotate.d/syslog-ng config file.  Because syslog-ng
depends on the cron service, the process looks like this:

stop vcron
stop syslog-ng
start syslog-ng
start vcron

However, at the point when we want to restart vcron, /usr/sbin/cron is
still running, presumably because there are other cron.daily jobs running
at the same time.  /sbin/start-stop-daemon sees the other cron running
and refuses to start /usr/sbin/cron again.

There is really no reason to re-start syslog-ng for log rotation since
syslog-ng is quite happy to receive SIGHUP to reopen the log files which
is why logrotate is messing with it at all.  By simply sending SIGHUP
to syslog-ng we avoid the whole issue of stopping and restarting vcron
via vcron.

The solution to this issue is the add a custom function
to /etc/init.d/syslog-ng (reload() ala xinetd) and change
/etc/logrotate.d/syslog-ng to call this function instead of restarting
the service.

I'll attach patches.

A big thanks to agriffis who had to listen to me whine about this for
some time and came through in the end with the fix and the pointer to
/etc/init.d/xinetd which I stole from with abandon.

Reproducible: Always
Steps to Reproduce:
1. install vcron, syslog-ng and logrotate
2. wait for run-crons to run the logrotate job in cron.daily
3. see that vcron isn't restarted properly

Actual Results:  
vcron wasn't restarted.

Expected Results:  
vcron should have been restarted.

Portage 2.0.47-r2 (default-1.0, gcc-2.95.3, glibc-2.2.5-r2,2.2.5-r7)
=================================================================
System uname: 2.4.19-gentoo-r7 i586 Pentium MMX
GENTOO_MIRRORS="http://csociety-ftp.ecn.purdue.edu/pub/gentoo
http://gentoo.oregonstate.edu/
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/bash_completion /etc/sound/events /etc/X11/rstart
/etc/X11/xdm /etc/pango /etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 oss 3dnow apm avi crypt cups encode jpeg libg++ mikmod mmx mpeg ncurses
pdflib qtmt sdl spell truetype xml2 xmms xv berkdb esd gdbm gif gnome gnome-libs
gtk guile java libwww oggvorbis opengl pam perl png python readline slang snmp
ssl tcpd tetex tiff X -quicktime -svga -motif -nls -imlib -kde -qt -arts gpm
mozilla"
COMPILER=""
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -O3 -pipe"
CXXFLAGS="-march=i586 -O3 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache userpriv"
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2003-02-24 15:35:34 UTC
Created attachment 8692 [details, diff]
patch to add opts and reload function to /etc/init.d/syslog-ng

This patch adds opts and a reload function to /etc/init.d/syslog-ng

The reload function allows us to get syslog-ng to reopen its logfiles without
having to call restart() which will shutdown the cron service as well.
Comment 2 Aron Griffis (RETIRED) gentoo-dev 2003-02-27 23:49:57 UTC
Fixed in 1.5.26-r1 (presently ~ masked).  Thanks!