From nobody@FreeBSD.org  Sun Aug 11 22:38:29 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 67B3237B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 11 Aug 2002 22:38:29 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 177E743E4A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 11 Aug 2002 22:38:29 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g7C5cSOT014627
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 11 Aug 2002 22:38:28 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g7C5cS03014626;
	Sun, 11 Aug 2002 22:38:28 -0700 (PDT)
Message-Id: <200208120538.g7C5cS03014626@www.freebsd.org>
Date: Sun, 11 Aug 2002 22:38:28 -0700 (PDT)
From: Konstantin M Volevatch <cox@rosnet.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Sendmail hoststat cleaning error
X-Send-Pr-Version: www-1.0

>Number:         41570
>Category:       conf
>Synopsis:       Sendmail hoststat cleaning error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 11 22:40:01 PDT 2002
>Closed-Date:    Mon Aug 12 04:10:33 PDT 2002
>Last-Modified:  Mon Sep 16 00:10:07 PDT 2002
>Originator:     Konstantin M Volevatch
>Release:        4.6-STABLE
>Organization:
Rosnet JSC
>Environment:
FreeBSD Main.RusMail.Net 4.6-STABLE FreeBSD 4.6-STABLE #0: Wed Aug  7 18:12:28 MSD 2002     root@CoX.RosNet.Ru:/usr/obj/usr/src/sys/MAIN  i386
>Description:
Host status located in /var/spool/.hoststat
But script /etc/periodic/daily/150.clean-hoststat (line 30) attempt to clean /var/.hoststat (line 39)
>How-To-Repeat:
      
>Fix:
Modify line 39 to correct value
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Mon Aug 12 04:09:57 PDT 2002 
State-Changed-Why:  
Fixed in -current; MFC in one week. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41570 

From: Alex Vasylenko <lxv@a-send-pr.sink.omut.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: conf/41570: Sendmail hoststat cleaning error
Date: Thu, 5 Sep 2002 16:49:38 -0700

 --EuxKj2iCbKjpUGkD
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 HostStatusDirectory is a configurable option in sendmail,
 so 150.clean-hoststat shouldn't blindly expect it to
 be /var/spool/.hoststat, besides HostStatusDirectory is
 relative to /var/spool/mqueue.
 
 The default location seems to be /var/spool/mqueue/.hoststat
 (see /usr/src/contrib/sendmail/cf/m4/proto.m4)
 
 I suggest we make the directory location configurable
 via periodic.conf
 
 Please see attached patches.
 
 --Alex.
 
 --EuxKj2iCbKjpUGkD
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch-150.clean-hoststat"
 
 --- 150.clean-hoststat	Mon Aug 12 04:09:01 2002
 +++ 150.clean-hoststat.new	Thu Sep  5 16:13:12 2002
 @@ -2,7 +2,7 @@
  #
  # $FreeBSD: src/etc/periodic/daily/150.clean-hoststat,v 1.6 2002/08/12 11:09:01 schweikh Exp $
  #
 -# Remove stale files in /var/spool/.hoststat
 +# Remove stale files from host status directory
  #
  
  # If there is a global system configuration file, suck it in.
 @@ -18,13 +18,13 @@
  	    echo '$daily_clean_hoststat_enable is enabled but' \
  		'$daily_clean_hoststat_days is not set'
  	    rc=2
 -	elif [ ! -d /var/spool/.hoststat ]; then
 +	elif [ ! -d $daily_clean_hoststat_dir ]; then
  	    echo '$daily_clean_hoststat_enable is enabled but' \
 -		"/var/spool/.hoststat doesn't exist"
 +		"$daily_clean_hoststat_dir doesn't exist"
  	    rc=2
  	else
  	    echo ""
 -	    echo "Removing stale files from /var/spool/.hoststat:"
 +	    echo "Removing stale files from $daily_clean_hoststat_dir:"
  
  	    case "$daily_clean_hoststat_verbose" in
  		[Yy][Ee][Ss])
 @@ -33,8 +33,8 @@
  		    print=;;
  	    esac
  
 -	    if [ -d /var/spool/.hoststat ]; then
 -		cd /var/spool/.hoststat
 +	    if [ -d $daily_clean_hoststat_dir ]; then 
 +		cd $daily_clean_hoststat_dir
  		rc=$(find . ! -name . -mtime +$daily_clean_hoststat_days \
  		    -delete $print | tee /dev/stderr | wc -l)
  		[ -z "$print" ] && rc=0
 
 --EuxKj2iCbKjpUGkD
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch-periodic.conf"
 
 --- periodic.conf	Fri Aug  9 13:58:54 2002
 +++ periodic.conf.new	Thu Sep  5 15:57:58 2002
 @@ -62,6 +62,7 @@
  # 150.clean-hoststat
  daily_clean_hoststat_enable="YES"			# Delete .hoststat daily
  daily_clean_hoststat_days=3				# If not modified for
 +daily_clean_hoststat_dir="/var/spool/mqueue/.hoststat"	# Host status directory
  daily_clean_hoststat_verbose="YES"			# Mention files deleted
  
  # 200.backup-passwd
 
 --EuxKj2iCbKjpUGkD--

From: Valentin Nechayev <netch@iv.nn.kiev.ua>
To: Alex Vasylenko <lxv@a-send-pr.sink.omut.org>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/41570: Sendmail hoststat cleaning error
Date: Sun, 15 Sep 2002 16:13:25 +0300

  Thu, Sep 05, 2002 at 16:50:04, lxv (Alex Vasylenko) wrote about "Re: conf/41570: Sendmail hoststat cleaning error": 
 
 AV>  HostStatusDirectory is a configurable option in sendmail,
 AV>  so 150.clean-hoststat shouldn't blindly expect it to
 AV>  be /var/spool/.hoststat, besides HostStatusDirectory is
 AV>  relative to /var/spool/mqueue.
 
 At all I can't see a need to such procedure, including find ... -delete,
 because sendmail has working implementation of hoststat base purging.
 Run `purgestat' or `sendmail -bH'.
 
 Thus, version I recommend is following (I'm not familiar with script return
 codes, hence fix what is wrong):
 
 === cut ===
 #!/bin/sh
 #
 # $FreeBSD: src/etc/periodic/daily/150.clean-hoststat,v 1.3.2.2 2000/09/20 02:46:15 jkh Exp $
 #
 # Remove stale files in /var/spool/.hoststat
 #
 
 # If there is a global system configuration file, suck it in.
 #
 if [ -r /etc/defaults/periodic.conf ]
 then
     . /etc/defaults/periodic.conf
     source_periodic_confs
 fi
 
 case "$daily_clean_hoststat_enable" in
     [Yy][Ee][Ss])
 	/usr/sbin/sendmail -bH
 	rc=$?
 	[ $rc -gt 1 ] && rc=1
 	;;
 
     *)  rc=0;;
 esac
 
 exit $rc
 === end cut ===
 
 
 /netch

From: Alex Vasylenko <lxv@a-send-pr.sink.omut.org>
To: Valentin Nechayev <netch@iv.nn.kiev.ua>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/41570: Sendmail hoststat cleaning error
Date: Sun, 15 Sep 2002 15:35:47 -0700

 On Sun, Sep 15, 2002 at 04:13:25PM +0300, Valentin Nechayev wrote:
 > At all I can't see a need to such procedure, including find ... -delete,
 > because sendmail has working implementation of hoststat base purging.
 > Run `purgestat' or `sendmail -bH'.
 > 
 
 your version doesn't implement the lifetime control of expiring 
 entries (currently controlled via daily_clean_hoststat_days),
 besides not all people have sendmail in their systems, so why not
 use simple standard tools to do the job.
 
 regards,
 --Alex.

From: Valentin Nechayev <netch@iv.nn.kiev.ua>
To: Alex Vasylenko <lxv@a-send-pr.sink.omut.org>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/41570: Sendmail hoststat cleaning error
Date: Mon, 16 Sep 2002 09:03:09 +0300

  Sun, Sep 15, 2002 at 15:35:47, lxv (Alex Vasylenko) wrote about "Re: conf/41570: Sendmail hoststat cleaning error": 
 
 >> At all I can't see a need to such procedure, including find ... -delete,
 >> because sendmail has working implementation of hoststat base purging.
 >> Run `purgestat' or `sendmail -bH'.
 AV> your version doesn't implement the lifetime control of expiring 
 AV> entries (currently controlled via daily_clean_hoststat_days),
 
 You are wrong. See `Timeout.hoststatus' in sendmail.cf. This is _real_ control.
 After timeout entry contents loses sense and isn't useful neither for sendmail
 (RTFM: sendmailop section 2.4) neither for sysadmin, sendmail ignores it.
 Default for this timeout is 30 minutes, i.e. much less then one day or
 a few days.
 
 Find ... -delete is reasonable only if someone has strong reason to keep
 entries, which are expired and invalid now, for manual checking. But I can't
 imagine reasons to do this.
 
 AV> besides not all people have sendmail in their systems, so why not
 AV> use simple standard tools to do the job.
 
 Wrong again. If one hasn't sendmail, it hasn't sendmail-specific host status
 base. For another MTA, algorithm for cleaning should be also another.
 Find ... -delete isn't automatically valid and safe for another MTA.
 If sysadmin changes sendmail to another MTA, he should change purgestat line
 in mailer.conf to program which does nothing or says complaint.
 
 
 /netch

From: Alex Vasylenko <lxv@a-send-pr.sink.omut.org>
To: Valentin Nechayev <netch@iv.nn.kiev.ua>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/41570: Sendmail hoststat cleaning error
Date: Mon, 16 Sep 2002 00:03:32 -0700

 On Mon, Sep 16, 2002 at 09:03:09AM +0300, Valentin Nechayev wrote:
 > AV> your version doesn't implement the lifetime control of expiring 
 > AV> entries (currently controlled via daily_clean_hoststat_days),
 > 
 > You are wrong. See `Timeout.hoststatus' in sendmail.cf. This is _real_ control.
 
 That controls when sendmail begins to ignore records. The 
 daily_clean_hoststat_days controls when the entries are of
 no interest to the administrator. For instance 'hoststat' shows
 host entries no matter sendmail uses them or not.
 
 I don't see how I'm wrong in my desire to keep the information
 around for however long I need it regardless of some tool's
 opinion as to usefulness of that information.
 
 Calm down, man! :)
 
 best regards,
 --Alex.
>Unformatted:
