From owner-freebsd-questions@FreeBSD.ORG Mon Mar 14 06:38:58 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E138106564A for ; Mon, 14 Mar 2011 06:38:58 +0000 (UTC) (envelope-from jhelfman@experts-exchange.com) Received: from mail.experts-exchange.com (mail.experts-exchange.com [72.29.183.251]) by mx1.freebsd.org (Postfix) with ESMTP id 196508FC19 for ; Mon, 14 Mar 2011 06:38:57 +0000 (UTC) Received: from mail.experts-exchange.com (localhost [127.0.0.1]) by mail.experts-exchange.com (Postfix) with ESMTP id 01DFC7138D0; Sun, 13 Mar 2011 23:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=e-e.com; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received:received; s=ee; t= 1300084736; x=1301899136; bh=qnm88w5C/5G2zLWBfSnGhg0stRCW0QhMCcz R+dvZppM=; b=CgzlOyckcRfi1UVvHeI6e/e7UOvLmejo1r7SfQuyUVtP9y4C5ra k8CvxoNFia3MXFfsUII9GBXnnpUjiR1pKPNUWPgownL51T4aENwcP9UHuDm3z+tf YE6xrXdhcV5gMqA+AFc2pPJBr788wJ+TNI5Y3vB6cSItXclk/bUQykdI= X-Virus-Scanned: amavisd-new at experts-exchange.com Received: from mail.experts-exchange.com ([127.0.0.1]) by mail.experts-exchange.com (mail.experts-exchange.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cdwu2mnVmKgy; Sun, 13 Mar 2011 23:38:56 -0700 (PDT) Received: from experts-exchange.com (unknown [72.29.180.81]) by mail.experts-exchange.com (Postfix) with SMTP id C5D477137F5; Sun, 13 Mar 2011 23:38:56 -0700 (PDT) Received: (nullmailer pid 64304 invoked by uid 1001); Mon, 14 Mar 2011 06:35:31 -0000 Date: Sun, 13 Mar 2011 23:35:31 -0700 From: Jason Helfman To: perryh@pluto.rain.com Message-ID: <20110314063531.GF13527@eggman.experts-exchange.com> References: <4d7d7894.ZVXy6HlL95xx+v0E%perryh@pluto.rain.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <4d7d7894.ZVXy6HlL95xx+v0E%perryh@pluto.rain.com> X-Operating-System: FreeBSD 8.2-RELEASE X-Living-The-Dream: I love the SLO Life! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-questions@freebsd.org Subject: Re: logging to dmesg from userland X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 06:38:58 -0000 On Sun, Mar 13, 2011 at 07:08:20PM -0700, perryh@pluto.rain.com thus spake: >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. man syslog should have all of the info you need. -jgh