Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2000 15:22:35 -0800
From:      "Kevin Oberman" <oberman@es.net>
To:        cjclark@alum.mit.edu
Cc:        Charlie Root <blaz@satx.rr.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: sendmail junk, other questions 
Message-ID:  <200011142322.eAENMZJ16137@ptavv.es.net>
In-Reply-To: Your message of "Sun, 12 Nov 2000 01:30:44 PST." <20001112013044.M75251@149.211.6.64.reflexcom.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
I recently ran into this problem, too. The source is that /etc/rc DOES
run sendmail regardless of the value of sendmail_enable if there is a
recoverable vi session on the system. 

I really wish that this was not the case. Unless you edit /etc/rc,
it's unavoidable and I don't think this is right. But I can live with
it.

The lines are at about 470 with the actual invocation at line 501 of
/etc/rc in Stable as of yesterday.

vibackup=`echo /var/tmp/vi.recover/vi.*`
if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then
        echo 'Recovering vi editor sessions'
        for i in /var/tmp/vi.recover/vi.*; do
                # Only test files that are readable.
                if [ ! -r "${i}" ]; then
                        continue
                fi

                # Unmodified nvi editor backup files either have the
                # execute bit set or are zero length.  Delete them.
                if [ -x "${i}" -o ! -s "${i}" ]; then
                        rm -f "${i}"
                fi
        done

        # It is possible to get incomplete recovery files, if the editor
        # crashes at the right time.
        virecovery=`echo /var/tmp/vi.recover/recover.*`
        if [ "${virecovery}" != "/var/tmp/vi.recover/recover.*" ]; then
                for i in /var/tmp/vi.recover/recover.*; do
                        # Only test files that are readable.
                        if [ ! -r "${i}" ]; then
                                continue
                        fi

                        # Delete any recovery files that are zero length,
                        # corrupted, or that have no corresponding backup file.
                        # Else send mail to the user.
                        recfile=`awk '/^X-vi-recover-path:/{print $2}' < "${i}"`
                        if [ -n "${recfile}" -a -s "${recfile}" ]; then
                                sendmail -t < "${i}"
                        else
                                rm -f "${i}"
                        fi
                done
        fi
fi

R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200011142322.eAENMZJ16137>