[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#354393: deb-354393-1.patch



I'm getting mail from cron with
    /etc/cron.daily/logrotate:
    grep: /etc/apache2/conf.d/[^.#]*: No such file or directory
rather too often due to this :\ (don't know if that happens in a default configuration of all the related packages though)

Patch to /etc/init.d/apache2 attached. The |for i in $AP_CONF ...| line expands glob words found on Include lines in config files, except for those that match nothing, which are passed on as such; before using each word from the expansion of glob words as a filename argument to grep, check that the corresponding file exists.

't.
--- /root/scratch/backup/apache2.~2006-03-14~	2006-01-16 12:15:48.000000000 +0200
+++ /etc/init.d/apache2	2006-03-14 23:09:45.000000000 +0200
@@ -37,6 +37,7 @@
 	# here, but only first-level includes are supported, not nested ones
 
 	for i in $AP_CONF `awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' $AP_CONF`; do
+		[ -e "$i" ] || continue
 		PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
 		if [ -e "$PIDFILE" ]; then
 			PID=`cat $PIDFILE`

Reply to: