Re: dmesg command
- To: debian-hurd@lists.debian.org
- Subject: Re: dmesg command
- From: Svante Signell <svante.signell@telia.com>
- Date: Tue, 01 Nov 2011 11:08:16 +0100
- Message-id: <[🔎] 1320142096.3990.66.camel@s1499.it.kth.se>
- Reply-to: svante.signell@telia.com
- In-reply-to: <1320086554.3990.52.camel@s1499.it.kth.se>
- References: <E1RKdpt-000756-Sg@vasks.debian.org> <871uttcyag.fsf@kepler.schwinge.homeip.net> <20111031112025.GH4154@type.famille.thibault.fr> <1320061511.3990.26.camel@s1499.it.kth.se> <20111031115057.GQ4154@type.famille.thibault.fr> <20111031123532.GU4154@type.famille.thibault.fr> <1320086554.3990.52.camel@s1499.it.kth.se>
On Mon, 2011-10-31 at 19:42 +0100, Svante Signell wrote:
> 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 || :
> > > > >
...
> > (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) :
Below is an updated script working for me (tm), with bashisms removed.
(As a temporary workaround until a proper dmesg has been written.)
apt-0.8.16~exp7 builds even if the following tests fails:
GlobalError_libapt_test and HashSums_libapt_test
dmesg is also used in apt-pkg/deb/dpkgpm.cc at: void
pkgDPkgPM::WriteApportReport to add to the report if pkg fails:
// attach dmesg log (to learn about segfaults)
For Hurd these segfaults will not be shown since the logfile is
truncated, but it would not do any harm either.
Additionally /var/log/dmesg has to be world readable (or the user has to
be in the adm group), is that a problem?
#!/bin/sh
if [ "$1" = "" ]; then
exec cat /var/log/dmesg
else
if [ -c /dev/klog ]; then
dd if=/dev/klog of=/var/log/dmesg &
sleep 1
kill $!
fi
fi
Reply to: