🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81067

Re: Logging failures

#81067
From: Ray Banana
Date: Tue, 19 May 2009 13:35
52 lines
4374 bytes
Thus spake "John F. Morse" <xanadu.bbs@example.invalid>

[problems with log file permissions on Ubuntu using sysklogd]

> The files are rotated, and the owner:group is indeed changed to
> syslog:adm -- and -- the files are not emptied. New logging is simply
> appended, causing the logs to grow.

I found the piece of code in the /etc/init.d/sysklogd startup script
that's responsible for this:

fix_log_ownership()
{
        for l in `syslogd-listfiles -a`
        do
                chown ${USER}:adm $l
        done
}

As I changed "syslogd-listfiles -a" to also list the news.* log files
(as does Ubuntu 9.04), these will be affected by this feature, too.

After looking at the sysklogd changelog for the Ubuntu version, I get the
impression that it is a long sequence of ugly hacks (and reverting them
again) in a desperate attempt to make sysklogd run without root
privileges, which does not work if you want your news.* logs handled
and rotated by news.daily. Ubuntu's sysklogd opens all defined log files
while it still has root privileges, disregarding their ownership. It
subsequently drops root privileges and, by default, runs as user syslog,
hence it fails to re-open the log files not writable by the syslog user
upon receiving a SIGHUP, as it has dropped its root privileges after
initializing. Doing a restart of sysklogd will work, as long as
syslogd-listfiles -a does *not* list the news.* files, as sysklogd will
start with root privileges, open all log files and drop
privileges. Sending a SIGHUP to the syslogd process will however cause
all logging to news.notice etc. to stop. 

So, if you would like to run INN on Ubuntu with news.daily doing all the
reporting and log rotation, you should not use sysklogd, but syslog-ng
or rsyslogd. You might prefer rsyslogd as the syntax of
/etc/rsyslogd.conf is the same as for syslogd.conf, whereas syslog-ng
uses a totally different logic and syntax (sources->filters->destinations).   

> Tonight I will install INN on the Optima11 box (Debian Lenny) and see
> what it does.

On Debian, sysklogd runs as root and therefore these problems do not
exist. 

-- 
Time flies like an arrow, fruit flies like a Banana.
http://news.motzarella.org
Technical Details
Message-ID: <804ovhp64z.fsf@banana.shacknet.nu>
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!newsfeed01.sul.t-online.de!t-online.de!feeder.erje.net!feeder.motzarella.org!news.motzarella.org!banana.shacknet.nu!motzarella.org!not-for-mail
References: <gts0rg$v7n$1@optima7.xanadu-bbs.net> <gu4ea9$ath$1@news.trigofacile.com> <gu6ksc$oq7$1@optima7.xanadu-bbs.net> <gu6uqv$1ap$1@news.trigofacile.com> <gu804a$4mb$1@optima7.xanadu-bbs.net> <gu8ggp$gic$1@news.trigofacile.com> <gu90j1$d21$1@optima7.xanadu-bbs.net> <gu9nvk$kse$1@news.trigofacile.com> <guc1rv$6qp$1@optima7.xanadu-bbs.net> <8063g6memf.fsf@banana.shacknet.nu> <guch30$aoq$1@optima7.xanadu-bbs.net> <80d4ae2k1j.fsf@banana.shacknet.nu> <gumema$ui2$1@optima7.xanadu-bbs.net> <80vdnzu827.fsf@banana.shacknet.nu> <guph24$oac$1@optima7.xanadu-bbs.net> <803ab3d2vg.fsf@banana.shacknet.nu> <guran2$7pi$1@optima7.xanadu-bbs.net>

Show Full Headers
Complete Article Headers
Message-ID: <804ovhp64z.fsf@banana.shacknet.nu>
Subject: Re: Logging failures
Date: Tue, 19 May 2009 15:35:40 +0200
From: Ray Banana <rayban@banana.shacknet.nu>
References: <gts0rg$v7n$1@optima7.xanadu-bbs.net> <gu4ea9$ath$1@news.trigofacile.com> <gu6ksc$oq7$1@optima7.xanadu-bbs.net> <gu6uqv$1ap$1@news.trigofacile.com> <gu804a$4mb$1@optima7.xanadu-bbs.net> <gu8ggp$gic$1@news.trigofacile.com> <gu90j1$d21$1@optima7.xanadu-bbs.net> <gu9nvk$kse$1@news.trigofacile.com> <guc1rv$6qp$1@optima7.xanadu-bbs.net> <8063g6memf.fsf@banana.shacknet.nu> <guch30$aoq$1@optima7.xanadu-bbs.net> <80d4ae2k1j.fsf@banana.shacknet.nu> <gumema$ui2$1@optima7.xanadu-bbs.net> <80vdnzu827.fsf@banana.shacknet.nu> <guph24$oac$1@optima7.xanadu-bbs.net> <803ab3d2vg.fsf@banana.shacknet.nu> <guran2$7pi$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!newsfeed01.sul.t-online.de!t-online.de!feeder.erje.net!feeder.motzarella.org!news.motzarella.org!banana.shacknet.nu!motzarella.org!not-for-mail
Newsgroups: news.software.nntp
Organization: A noiseless patient spider
Lines: 52
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.eternal-september.org
 U2FsdGVkX19HDqnhZa3+ar5ESrysxKNnYO+Lvwub8bSvh1zIZodDquEvBejh1OwRSpmglfDVRtUCLi9462EG4uXlkQ18zl9HE1zM7SSgZVaWaxrtywX7+WCPEUe7Tn0YR0FyfeCV6ZA=
X-Complaints-To: abuse@banana.shacknet.nu
X-Auth-Sender: U2FsdGVkX198pSFwD7pkVkKVC10BTYmqs6PsVA+IYx0ubRdUX/udAA==
Cancel-Lock: sha1:eh7kHhzP+y8dHRfDExvoPauhQJU=
 sha1:LYf0d18WUXMHxOMvaLcyO3ABFRc=
User-Agent: Plonkenlights
X-PGP-Sig: 2.6.3ia Subject,Message-ID,Date,From,User-Agent
 iQCVAwUBShK15BFgDSXFGJ/lAQH1KgP/aGGQcTLgTA/8a0Gcr7O0vP9NsTOyTAom
 Ykq52fgaRju9JXBsf6oiMopL53sLCTxzWpU1hLbyeiJKzrMeFlwPkxeoKEVY4snJ
 K04epPhVSHHjVy/TIsOMMnDkdKOEAmwNKnJU3xK4TC7VDEcVBaqOfsjl/Cy2WJF0
 ErlCCAya6f0= =59LY
X-Attribution: Ray Banana