*BSD News Article 13683


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!uwm.edu!cs.utexas.edu!sun-barr!ames!agate!usenet.ins.cwru.edu!jake.EEAP.CWRU.Edu!david
From: david@jake.EEAP.CWRU.Edu (David Nerenberg)
Newsgroups: comp.os.386bsd.questions
Subject: Re: Rotating the syslogs
Date: 30 Mar 1993 16:58:34 GMT
Organization: Case Western Reserve University
Lines: 59
Message-ID: <1p9u7q$ga4@usenet.INS.CWRU.Edu>
References: <1p77tt$rq3@usenet.INS.CWRU.Edu> <g89r4222.733427031@kudu> <1993Mar29.224423.12286@mnemosyne.cs.du.edu>
NNTP-Posting-Host: jake.eeap.cwru.edu

In article <1993Mar29.224423.12286@mnemosyne.cs.du.edu> smace@nyx.cs.du.edu (Scott Mace) writes:
>In article <g89r4222.733427031@kudu> g89r4222@kudu.ru.ac.za (Geoff Rehmet) writes:
>>In <1p77tt$rq3@usenet.INS.CWRU.Edu> david@jake.EEAP.CWRU.Edu (David Nerenberg) writes:
>>
>>Yu shouldn't really have a problem.  Note that the bindist comes
>>with files /etc/daily and /etc/weekly, which should be run daily
>>and weekly respectively, to do things like rotating logs.
>>
>
>[stuff deleted]
>
>>chmod 644 messages
>>kill -1 `cat /var/run/syslog.pid`
>^^^^^^^^^^^^^^^^^^^^^^^^
>I've always had problems with this, my system gets real funky when this
>executes.  I sometimes locks my keyboard in X, and also more(1)
>complains about not having some ioctl.  Strange.....
>Has anyone else encountered this?

This too is my problem.  My cron will happily rotate the files all around,
and syslog will happily continue writing to the messages.0 file.  Sending
a SIGHUP to syslog is supposed to be all that is necessary, but it is 
broken.  Following is the problem and partial solution as outlined to me:
(I have never rebuilt init and I use the stock console driver.  I have 
 not yet had a chance to try it - Thanks for the help Christoph)

[ directly quoted material follows ]

From: chmr@edvz.tu-graz.ac.at (Christoph Robitschko)

The kill -HUP does nothing because the /sbin/init program is broken
(in several ways) on 0.1 . It does not set the signal mask for daemons right.
I think it is fixed in the patchkit, you just have to rebuild it
(cd /usr/src/sbin/init; make; mv /sbin/init /sbin/init.old; make install).

After you fixed that, your cmputer will probably hang after the kill -HUP
too 8-( . That is because the pccons device is used via two device files
(/dev/vga and /dev/console) simultaneously. When one is closed, the other
is disabled as well and gives the appearance that the system locked up
(it really is only the pccons device). Nobody has really
fixed that bug, but you have the following options:

	Use a different console device driver, such as syscons (gives you
		virtual consoles, keyboard mappings, fonts), codrv
		(keyboard mappings, fonts) or pcvt (true VT220 emulation,..)
		They (at least syscons and codrv, don't really know about
		pcvt) don't have this problem.
	Don't use /dev/vga as your login device (not possible if you have
		XFree).
	Make sure you always have the /dev/console device open by a process
		(you could hack init to do this, or simply start a 
		nohup sleep 10000000 > /dev/console & from /etc/rc.local .


-- 
david@elwood.eeap.cwru.edu             David Nerenberg
73107,177 CompuServe                   Electrical Engineering & Applied Physics
NY:  H-516-751-6344                    Case Western Reserve University
     W-516-751-8111                    W-216-368-2982   H-216-754-2085