logging to dmesg from userland

perryh at pluto.rain.com perryh at pluto.rain.com
Mon Mar 14 02:13:23 UTC 2011


I am looking for a way to write into the kernel message buffer --
the one that dmesg prints out -- from a userland program, to help
in relating kernel printf messages to the userland operations which
provoked them.  (Yes, I am aware of the potential DoS implications:
the capability should be restricted to root, or at least to the
"operator" group.  I expect to use it only in single-user mode.)

Is there a program, or a system call, which can do this?  logger(1)
seemed a likely prospect, but either it doesn't have this capability
or I haven't found the formula.


More information about the freebsd-questions mailing list