🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #80897

Re: Suggestion for mailpost

#80897
From: John F. Morse
Date: Tue, 05 May 2009 08:22
509 lines
18615 bytes
Russ Allbery wrote:
> "John F. Morse" <xanadu.bbs@example.invalid> writes:
>
>   
>> Since you guys are discussing syslog, perhaps you can help me with a
>> syslog problem I have been diagnosing for the past two weeks?
>>
>> I don't know if it is associated with INN or not. None of my various
>> tests have proven anything.
>>     
>
> I assume you've already followed the instructions in INSTALL for how to
> set up syslog?
>   


The DEB-APT did all the work (I did not compile). But I have compared
configs for any differences.

The syslog.conf is posted below. If you see something amiss, please holler.

BTW, the particulars and peculiarities are as follows:

Optima5 is the computer that is failing to restart syslog after nightly
rotation. It appears syslogd gets restarted, but nothing is logged.

Optima5 is the PC I'm experiencing this weird problem with. It is
running INN 2.4.4 fine, with tradspool and cnfs, and peering with
Optima7, the online server, which has INN 2.4.3 on Debian Sarge.

Optima5 is identical to Optima2, a test machine I used for comparison,
except Optima5 has a 40 GB hard drive (clipped to 32 GB), while Optima2
has a 4.3 GB hard drive. And Optima5 has INN 2.4.4 while Optima2 does
not yet have INN installed.

They both have Ubuntu 8.04 LTS Server Edition, and the only additional
added packages on both are openssh-server and ntp.

Both are current with updates and upgrades.

The syslog works fine on Optima2, including rotation. A tail of syslog
(tail -F -n 1000 /var/log/syslog) works fine, day after day. I get the
usual "...has been replaced;  following end of new file" messages.
Again, Optima2 has no INN, and was used only to compare logging
configurations and options during this trouble.

The syslog on Optima5 will rotate, but then it never restarts at 0638
daily. Here is what the area looks like right now:

-rw-r----- 1 syslog      adm       0 2009-05-04 06:38 syslog
-rw-r----- 1 root        adm  187770 2009-05-05 00:45 syslog.0
-rw-r----- 1 root        adm    9021 2009-05-03 13:15 syslog.1.gz

I can kill the syslogd by PID, then relaunch it, and it works until the
next morning.

I have tried chown syslog to root:adm (like it is on Optima7, the Sarge
box with older INN 2.4.3, which, BTW, is working fine), but in the
morning, I find it has reset back to syslog:adm as the owner and group,
and the filesize is zero as shown above. (Syslog.0 seems to be working
OK. Perhaps it is where INN's news.notice is getting logging data?)

This morning the INN news.notice kept on running (it rotated properly):

-rw-r--r-- 1 news news  14625 2009-05-05 02:52 news.notice

Right now I also see:

news@optima5:/var/log/news$ ps aux | grep syslogd
news     12734  0.0  0.2   2912   740 pts/4    S+   02:32   0:00 grep
syslogd
root     25999  0.0  0.2   1672   588 ?        Ss   May02   0:03 syslogd

Syslogd hasn't made a entry or been restarted since May02, almost three
days ago.

A few days ago news.notice would stop displaying any new logging at the
same time the syslog failed to rotate and not restart. I presumed
because it had no new syslog data to log and display.

If you remember a couple of weeks ago, when this was a brand new system,
news.notice was not working, so I rebooted the system. Then news.notice
started displaying when tailed.

INN itself is working fine on Optima5, including log rotation, but only
this syslog dieing around 0638 every morning is keeping me from putting
this server into production service.

Last week I was tailing news.notice and syslog, so I stopped tailing
syslog to see if tailing news.notice might be a cause. Still syslog
wouldn't restart after logs were rotated.

I have issued (as user news):

ctlinnd throttle
rc.news stop

And then I let Optima5 run all night without INN running -- but syslogd
still failed to restart (this is with INN out of the picture -- not
running anyway). Kind of takes the blame off of INN.

I've compared all relevant configuration files between Optima5 and
Optima2, and even what is similar from Optima7, and can't find out what
is keeping syslogd from restarting and actually logging after the
logrotate runs.

Here's that syslog.conf, but I don't think there are any errors in it.
The only oddity between it and Optima2 is the hyphen in the news.notice
pathname (which Optima7 does have). That shouldn't affect syslogd from
logging other system data. The hyphen is in Optima7's syslog.conf, but
not in Optima5's.



john@optima5:/etc$ cat syslog.conf
#  /etc/syslog.conf    Configuration file for syslogd.
#
#            For more information see syslog.conf(5)
#            manpage.

#
# First some standard logfiles.  Log by facility.
#

auth,authpriv.*            /var/log/auth.log
*.*;auth,authpriv.none        -/var/log/syslog
#cron.*                /var/log/cron.log
daemon.*            -/var/log/daemon.log
kern.*                -/var/log/kern.log
lpr.*                -/var/log/lpr.log
mail.*                -/var/log/mail.log
user.*                -/var/log/user.log

#
# Logging for the mail system.  Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info            -/var/log/mail.info
mail.warn            -/var/log/mail.warn
mail.err            /var/log/mail.err

# Logging for INN news system
#
news.crit            /var/log/news/news.crit
news.err            /var/log/news/news.err
news.notice            -/var/log/news/news.notice

#
# Some `catch-all' logfiles.
#
*.=debug;\
    auth,authpriv.none;\
    news.none;mail.none    -/var/log/debug
*.=info;*.=notice;*.=warn;\
    auth,authpriv.none;\
    cron,daemon.none;\
    mail,news.none        -/var/log/messages

#
# Emergencies are sent to everybody logged in.
#
*.emerg                *

#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
#    news.=crit;news.=err;news.=notice;\
#    *.=debug;*.=info;\
#    *.=notice;*.=warn    /dev/tty8

# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
# you must invoke `xconsole' with the `-file' option:
#
#    $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
#      busy site..
#
daemon.*;mail.*;\
    news.crit;news.err;news.notice;\
    *.=debug;*.=info;\
    *.=notice;*.=warn    |/dev/xconsole



And (after killing syslogd PID) this might help:


john@optima5:/var/log$ sudo syslogd -d
Allocated parts table for 1024 file descriptors.
Starting.
Called init.
Called allocate_log, nlogs = -1.
cfline(auth,authpriv.*            /var/log/auth.log)
symbolic name: * ==> 255
symbolic name: auth ==> 32
symbolic name: authpriv ==> 80
leading char in action: /
filename: /var/log/auth.log
Called allocate_log, nlogs = 0.
cfline(*.*;auth,authpriv.none        -/var/log/syslog)
symbolic name: * ==> 255
symbolic name: none ==> 16
symbolic name: auth ==> 32
symbolic name: authpriv ==> 80
leading char in action: /
filename: /var/log/syslog
Called allocate_log, nlogs = 1.
cfline(daemon.*            -/var/log/daemon.log)
symbolic name: * ==> 255
symbolic name: daemon ==> 24
leading char in action: /
filename: /var/log/daemon.log
Called allocate_log, nlogs = 2.
cfline(kern.*                -/var/log/kern.log)
symbolic name: * ==> 255
symbolic name: kern ==> 0
leading char in action: /
filename: /var/log/kern.log
Called allocate_log, nlogs = 3.
cfline(lpr.*                -/var/log/lpr.log)
symbolic name: * ==> 255
symbolic name: lpr ==> 48
leading char in action: /
filename: /var/log/lpr.log
Called allocate_log, nlogs = 4.
cfline(mail.*                -/var/log/mail.log)
symbolic name: * ==> 255
symbolic name: mail ==> 16
leading char in action: /
filename: /var/log/mail.log
Called allocate_log, nlogs = 5.
cfline(user.*                -/var/log/user.log)
symbolic name: * ==> 255
symbolic name: user ==> 8
leading char in action: /
filename: /var/log/user.log
Called allocate_log, nlogs = 6.
cfline(mail.info            -/var/log/mail.info)
symbolic name: info ==> 6
symbolic name: mail ==> 16
leading char in action: /
filename: /var/log/mail.info
Called allocate_log, nlogs = 7.
cfline(mail.warn            -/var/log/mail.warn)
symbolic name: warn ==> 4
symbolic name: mail ==> 16
leading char in action: /
filename: /var/log/mail.warn
Called allocate_log, nlogs = 8.
cfline(mail.err            /var/log/mail.err)
symbolic name: err ==> 3
symbolic name: mail ==> 16
leading char in action: /
filename: /var/log/mail.err
Called allocate_log, nlogs = 9.
cfline(news.crit            /var/log/news/news.crit)
symbolic name: crit ==> 2
symbolic name: news ==> 56
leading char in action: /
filename: /var/log/news/news.crit
Called allocate_log, nlogs = 10.
cfline(news.err            /var/log/news/news.err)
symbolic name: err ==> 3
symbolic name: news ==> 56
leading char in action: /
filename: /var/log/news/news.err
Called allocate_log, nlogs = 11.
cfline(news.notice            -/var/log/news/news.notice)
symbolic name: notice ==> 5
symbolic name: news ==> 56
leading char in action: /
filename: /var/log/news/news.notice
Called allocate_log, nlogs = 12.
cfline(*.=debug;auth,authpriv.none;news.none;mail.none    -/var/log/debug)
symbolic name: debug ==> 7
symbolic name: none ==> 16
symbolic name: auth ==> 32
symbolic name: authpriv ==> 80
symbolic name: none ==> 16
symbolic name: news ==> 56
symbolic name: none ==> 16
symbolic name: mail ==> 16
leading char in action: /
filename: /var/log/debug
Called allocate_log, nlogs = 13.
cfline(*.=info;*.=notice;*.=warn;auth,authpriv.none;cron,daemon.none;mail,news.none   
    -/var/log/messages)
symbolic name: info ==> 6
symbolic name: notice ==> 5
symbolic name: warn ==> 4
symbolic name: none ==> 16
symbolic name: auth ==> 32
symbolic name: authpriv ==> 80
symbolic name: none ==> 16
symbolic name: cron ==> 72
symbolic name: daemon ==> 24
symbolic name: none ==> 16
symbolic name: mail ==> 16
symbolic name: news ==> 56
leading char in action: /
filename: /var/log/messages
Called allocate_log, nlogs = 14.
cfline(*.emerg                *)
symbolic name: emerg ==> 0
leading char in action: *
write-all
Called allocate_log, nlogs = 15.
cfline(daemon.*;mail.*;news.crit;news.err;news.notice;*.=debug;*.=info;*.=notice;*.=warn   
|/dev/xconsole)
symbolic name: * ==> 255
symbolic name: daemon ==> 24
symbolic name: * ==> 255
symbolic name: mail ==> 16
symbolic name: crit ==> 2
symbolic name: news ==> 56
symbolic name: err ==> 3
symbolic name: news ==> 56
symbolic name: notice ==> 5
symbolic name: news ==> 56
symbolic name: debug ==> 7
symbolic name: info ==> 6
symbolic name: notice ==> 5
symbolic name: warn ==> 4
leading char in action: |
filename: |/dev/xconsole
Opened UNIX socket `/dev/log'.
 0:  X  X  X  X FF  X  X  X  X  X FF  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/auth.log
 1: FF FF FF FF  X FF FF FF FF FF  X FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FILE: /var/log/syslog
 2:  X  X  X FF  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/daemon.log
 3: FF  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/kern.log
 4:  X  X  X  X  X  X FF  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/lpr.log
 5:  X  X FF  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/mail.log
 6:  X FF  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/user.log
 7:  X  X 7F  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/mail.info
 8:  X  X 1F  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/mail.warn
 9:  X  X  F  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/mail.err
10:  X  X  X  X  X  X  X  7  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/news/news.crit
11:  X  X  X  X  X  X  X  F  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/news/news.err
12:  X  X  X  X  X  X  X 3F  X  X  X  X  X  X  X  X  X  X  X  X  X  X 
X  X  X FILE: /var/log/news/news.notice
13: 80 80  X 80  X 80 80  X 80 80  X 80 80 80 80 80 80 80 80 80 80 80 80
80 80 FILE: /var/log/debug
14: 70 70  X  X  X 70 70  X 70  X  X 70 70 70 70 70 70 70 70 70 70 70 70
70 70 FILE: /var/log/messages
15:  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1 
1  1  1 WALL:
16: F0 F0 FF FF F0 F0 F0 FF F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0
F0 F0 PIPE: |/dev/xconsole
logmsg: syslog.info<46>, flags 4, from optima5, msg syslogd
1.5.0#1ubuntu1: restart.
Called fprintlog, logging to FILE /var/log/syslog
Called fprintlog, logging to FILE /var/log/messages
Called fprintlog, logging to PIPE |/dev/xconsole
syslogd: restarted.
Debugging disabled, SIGUSR1 to turn on debugging.


And it is now running (because it was restarted above):


-rw-r----- 1 syslog      adm    1381 2009-05-05 02:51 syslog


Since I have the ssh terminal up, let me provide you with a few more
configuration files' data:

------------------------------------------------------------------------

john@optima5:/etc$ cat logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be configured here

------------------------------------------------------------------------

john@optima5:/etc$ cat crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user    command
17 *    * * *    root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *    root    test -x /usr/sbin/anacron || ( cd / &&
run-parts --report /etc/cron.daily )
47 6    * * 7    root    test -x /usr/sbin/anacron || ( cd / &&
run-parts --report /etc/cron.weekly )
52 6    1 * *    root    test -x /usr/sbin/anacron || ( cd / &&
run-parts --report /etc/cron.monthly )
#

------------------------------------------------------------------------

john@optima5:/etc/cron.daily$ cat logrotate
#!/bin/sh

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

------------------------------------------------------------------------

john@optima5:/etc/cron.daily$ cat sysklogd
#! /bin/sh

# sysklogd    Cron script to rotate system log files daily.
#
#        If you want to rotate other logfiles daily, edit
#        this script.  An easy way is to add files manually,
#        to add -a (for all log files) to syslogd-listfiles and
#        add some grep stuff, or use the -s pattern argument to
#        specify files that must not be listed.
#
#        This is a configration file.  You are invited to edit
#        it and maintain it on your own.  You'll have to do
#        that if you don't like the default policy
#        wrt. rotating logfiles (i.e. with large logfiles
#        weekly and daily rotation may interfere).  If you edit
#        this file and don't let dpkg upgrade it, you have full
#        control over it.  Please read the manpage to
#        syslogd-listfiles.
#
#        Written by Martin Schulze <joey@debian.org>.
#        $Id: cron.daily,v 1.14 2007-05-28 16:33:34 joey Exp $

test -x /usr/sbin/syslogd-listfiles || exit 0
test -x /sbin/syslogd || exit 0
test -f /usr/share/sysklogd/dummy || exit 0

USER=$(ps -C syslogd -o user= | head -n 1)
[ -z "${USER}" ] && USER="root" || true

set -e

cd /var/log

logs=$(syslogd-listfiles)

test -n "$logs" || exit 0

for LOG in $logs
do
   if [ -s $LOG ]; then
      savelog -g adm -m 640 -u ${USER} -c 7 $LOG >/dev/null
   fi
done

# Restart syslogd
#
/etc/init.d/sysklogd reload-or-restart > /dev/null

------------------------------------------------------------------------

Ideas?


-- 
John 

No Microsoft, Apple, AT&T, Novell, Trend Micro, nor Ford products were used in the preparation or transmission of this message.

The EULA sounds like it was written by a team of lawyers who want to tell me what I can't do. The GPL sounds like it was written by a human being, who wants me to know what I can do.
Technical Details
Message-ID: <gtosvp$5ik$1@optima7.xanadu-bbs.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!feeder.news-service.com!feeder.motzarella.org!motzarella.org!optima7.xanadu-bbs.net!not-for-mail
References: <878wnex9f4.fsf@windlord.stanford.edu> <75mc7qF195jsaU1@mid.individual.net> <gtj1pq$4hl$1@aux.snarked.org> <gtl4ia$656$1@news.trigofacile.com> <gtl8s9$fjr$1@aux.snarked.org> <gtm26e$29u$1@news.trigofacile.com> <87vdog7mkm.fsf@windlord.stanford.edu> <gto012$te3$4@optima7.xanadu-bbs.net> <87d4aojtbe.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <gtosvp$5ik$1@optima7.xanadu-bbs.net>
Subject: Re: Suggestion for mailpost
Date: Tue, 05 May 2009 03:22:17 -0500
From: "John F. Morse" <xanadu.bbs@example.invalid>
References: <878wnex9f4.fsf@windlord.stanford.edu> <75mc7qF195jsaU1@mid.individual.net> <gtj1pq$4hl$1@aux.snarked.org> <gtl4ia$656$1@news.trigofacile.com> <gtl8s9$fjr$1@aux.snarked.org> <gtm26e$29u$1@news.trigofacile.com> <87vdog7mkm.fsf@windlord.stanford.edu> <gto012$te3$4@optima7.xanadu-bbs.net> <87d4aojtbe.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!feeder.news-service.com!feeder.motzarella.org!motzarella.org!optima7.xanadu-bbs.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Xanadu BBS
Lines: 509
Reply-To: dont.bother
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: optima7.xanadu-bbs.net 1241511737 5716 192.168.89.210 (5 May 2009
X-Complaints-To: newsmaster@xanadu-bbs.net
NNTP-Posting-Date: Tue, 5 May 2009 08:22:17 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.21 (X11/20090318)
In-Reply-To: <87d4aojtbe.fsf@windlord.stanford.edu>