Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2003 00:48:21 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        arch@FreeBSD.ORG
Subject:   Re: NEWSYSLOG changes, -Create option for rc.diskless
Message-ID:  <20030310000219.N15648-100000@gamplex.bde.org>
In-Reply-To: <p05200f18ba907f20159a@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 9 Mar 2003, Garance A Drosihn wrote:

> When looking through some /etc/rc files the other day, I noticed
> that /etc/rc.diskless2 picks up entries in /etc/newsyslog.conf
> and uses 'touch' to create them.  With all the other changes I
> have made and plan to make, this is not a good idea.  In fact, it
> was already a bad idea because it won't get owner, group, or
> permissions set right.
>
> I have an update in:
> http://people.freebsd.org/~gad/newsyslog/create-opt.diff
>
> which implements a '-C' option for newyslog.  Once this is
> committed, /etc/rc.diskless2 should be changed to use it.  The
> update also adds a a 'C' flag for the config file entries, to
> match an option that NetBSD has.
>
> Please pay close attention to the new createlog() routine, as a
> later update will switch to using that for all logfile creations.
> My goal was to eliminate all windows in the create of a new log
> file.  This (once I do it) should complete the job started in
> revision 1.41 (committed in april 2002).

mtree(8) should be used to control the original files.  The original
set of files very little to do with newsyslog.  It has more to do
with syslogd, but it's normal for both syslog.conf and newsyslog.conf
to have default rules for files that don't exist, with the actual
creation done manually.  Manual creation is too hard to do for diskless
mounts, so we need a database, and mtree(8) handles this perfectly:

%%%
Script started on Mon Mar 10 00:18:22 2003
ttyp0:root@besplex:/tmp> cat /etc/mtree/BSD.log.dist
# $FreeBSD$
#
# Please see the file src/etc/mtree/README before making changes to this file.
#

/set type=file uname=root gname=wheel mode=0644
.               type=dir mode=0755
    auth.log        mode=0600
    cron            mode=0600
    lastlog
    lpd-errs
    maillog         mode=0640
    messages
    ppp.log         gname=network mode=0640
    security        mode=0600
    slip.log        gname=network mode=0640
    wtmp
    xferlog         mode=0600
..
ttyp0:root@besplex:/tmp> mtree -f /etc/mtree/BSD.log.dist -p /var/log
sendmail.st extra
setuid.today extra
setuid.yesterday extra
mount.today extra
mount.yesterday extra
cron.0.gz extra
messages.0.gz extra
console.log extra
messages.1.gz extra
messages.2.gz extra
messages.3.gz extra
messages.4.gz extra
ppp.log.0.gz extra
connect-errors extra
console.log.0.gz extra
ttyp0:root@besplex:/tmp> exit

Script done on Mon Mar 10 00:19:20 2003
%%%

I created the database using mergemaster to an empty tree.  This uses
mainly src/etc/Makefile.  The Makefile should use a database too, and
at least the customized version of the database should have a few more
files so that there are no "extras" except .gz's.

Bruce


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




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