tiger-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tiger-devel] Merge update and problems with check_logfiles merge.


From: Javier Fernandez-Sanguino
Subject: Re: [Tiger-devel] Merge update and problems with check_logfiles merge.
Date: Tue, 01 Jul 2003 11:31:14 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01

Ryan Bradetich wrote:
Hello all,


I have managed to sync up my local tree against the current CVS HEAD. The only file that requires a non-trivial merge was the
scripts/check_logfiles.

(...)
Not all of the patch was applied, so please ignore the rest of this
email if the patch is still in the process of being applied.


It is now, you are right to pointing at some pieces that I missed.


My first concern is with this piece of code:

(...)
I agree that the LOGINLOG does not appear to be present under Linux, but BTMP definately is. By default the BTMP file is not present, but
if the file is created, bad login data will be stored in the file.

You are right. I will add it to the check.

The next section I need has the HP-UX specific logfiles. I see the way to modify which files are present has changes slightly, no problem I can
regenerate a patch in that format once agree on the patch contents :)

What hast changed? There has not been that much of a change... I probably have to add code to say something if the variables are not defined.

The next section is the permission check for the BTMP files was not
added :)  Generally the permissions on the BTMP file need to be tighter
(...)

You are right.

The WTMP, LOGINLOG, UTMP, LASTLOG, and MESSAGES do not check to see if
the variables are defined to a file before throwing an error, claiming
the file does not exist.  Arguably the WTMP and UTMP will be present on
all systems, but according to the lastb man page WTMP is a local
configuration option as well.  HP-UX only has WTMP, UTMP, and BTMP
defined, and Tru64 only has WTMP and UTMP defined.  I think it is a good
idea to verify the log file is defined before throwing a message it does
not exist.

Ok. I will add some message in the else clause of the [ -n "LOGFILE" ]. Maybe a configuration error.

Thoughts/feedback?


I will be happy to generate a new patch against the CVS HEAD with this if everyone is agreeable, or I can make any changes once I understand
what is wrong with my logic :)

The only issue is that I don't want to do an
+if [ -n "$UTMP" ] ; then
(...)
+fi

Without an else clause, some variables should be defined since they are configured in the script:

WTMP=/var/log/wtmp
BTMP=/var/log/btmp
LASTLOG=/var/log/lastlog
UTMP=/var/run/utmp
LOGINLOG=/var/log/loginlog
MESSAGES=/var/log/messages

And then modified per OS. It might make more sense to define this variables in the config script of each OS with a failback here if not defined or add them to the haveallvars check (after the 'haveallcmds'). A proper flow could be:

1.- each OS config script defines (and exports) proper WTMP/BTMP/LASTLOG... variables

2.- The script checks if a common set of variables are defined (WTMP, UTMP and MESSAGES?), this is done by haveallvars. If they are not it will abort.

3.- Other variables (BTMP, LASTLOG, LOGINLOG, BTMP..) must be checked before using them (with the [ -n "XXX" ] code) but no warning will be given if they are not available.

This avoids adding the "$OS" clauses and puts that configuration into where it should be (systems/$OS/config).

I will have to patch some more pieces than just this script for that to work. Give me some time and I will implement it using some of the information you provided in the patch and in your mail.

Thanks!

Javi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]