Re: dmesg command
On Mon, 2011-10-31 at 13:35 +0100, Samuel Thibault wrote:
> Samuel Thibault, le Mon 31 Oct 2011 12:50:57 +0100, a écrit :
> > Svante Signell, le Mon 31 Oct 2011 12:45:11 +0100, a écrit :
> > > On Mon, 2011-10-31 at 12:20 +0100, Samuel Thibault wrote:
> > > > Thomas Schwinge, le Mon 31 Oct 2011 10:20:39 +0100, a écrit :
> > > > > # Save kernel messages in /var/log/dmesg
> > > > > if which dmesg >/dev/null 2>&1
> > > > > then
> > > > > [ -f /var/log/dmesg ] && savelog -q -p -c 5 /var/log/dmesg
> > > > > dmesg -s 524288 > /var/log/dmesg
> > > > > chgrp adm /var/log/dmesg || :
> > > >
> > > > d'oh.
> > > >
> > > > apt will have to find another way than dmesg, then.
> > >
> > > Is proposing a change to the the bootlogs script forbidden/impractical?
> >
> > It will be harder to justify than chaging the just-added code in apt.
> > Inverting the tests will make kfreebsd use /dev/klog instead of dmesg,
> > it's not an innocent change.
>
> (the idea of just catting /var/log/dmesg was interesting, but the
> example above shows that it'd be considered convoluted, we should
> probably just implement a proper dmesg which eats /dev/klog without
> blocking)
What about creating a script dmesg doing similar to the following (save
for syntax errors) :
if [ "$1" == "-s" ]; then
dd if=/dev/klog of=/var/log/dmesg &
sleep 1
kill $!
else
exec cat /var/log/dmesg
fi
Or to do the first condition if $1 is empty:
if [ "$1" == "" ]; then
exec cat /var/log/dmesg
else
dd if=/dev/klog of=/var/log/dmesg &
sleep 1
kill $!
fi
Just my 5c!
Reply to: