ktrace help

Polytropon freebsd at edvax.de
Wed Nov 6 10:53:26 UTC 2013


On Wed, 06 Nov 2013 01:16:02 -0800 (PST), Anton Shterenlikht wrote:
> I suspect that nginx causes my box to reboot.
> I don't get a panic or anything in the logs,
> just a reboot. So I wanted to see what nginx
> is doing prior to reboot with ktrace.
> 
> I launch ktrace as "ktrace nginx",
> and I see that ktrace.out has some data.
> However, after reboot, it's empty:
> 
> -rw-------   1 root  wheel    0 Nov  6 09:04 ktrace.out
> 
> Is this expected?

Not intended, but can maybe be explained: The ktrace.out file
is continuously written to, but at the time the system crashes
and reboots, the data is lost because the file system is terribly
interrupted in an inconsistent state. When the system boots up
again, the damaged file is restored, but the data isn't associated
anymore (and therefore lost). I don't know in how far it would
be possible to have ktrace's output rerouted to a different kind
of storage (e. g. a slower NFS share or a pipe that a different
host / machine is listening to over the network)... In that case,
all output that is lucky of being transmitted can be captured
and won't be lost when the accidental reboot appears.

By the way, this is an excellent example of a use case for a
sufficiently fast and buffered dotmatrix line printer. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list