From owner-freebsd-hackers Mon Sep 13 13:26:49 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 4969915121 for ; Mon, 13 Sep 1999 13:26:45 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from sol.cs.binghamton.edu (cs1-gw.cs.binghamton.edu [128.226.171.72]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with SMTP id QAA07094; Mon, 13 Sep 1999 16:26:42 -0400 (EDT) Date: Mon, 13 Sep 1999 16:12:44 -0400 (EDT) From: Zhihui Zhang To: "Brian Mitchell (ISSATL)" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Let a daemon process print a message In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 13 Sep 1999, Brian Mitchell (ISSATL) wrote: > syslog() with the proper facility is probably the best way to do this. > Another possibility is opening /dev/console, but I think that will aquire > a controlling terminal. > > On Mon, 13 Sep 1999, Zhihui Zhang wrote: > > > > > Can anyone tell me how to let a daemon process print a message to the > > console? Adding printf() does not work (I wonder if a daemon process > > has been cut of relationship with stdout). Thanks for any help. > > I have tested syslog(). I find out: (1) The log messages will go into /var/log/messages and appear on the console only after I login in (as root). (2) The LOG_INFO priority does not cause the messages to appear on the console or to be written into file /var/log/messages. Can anyone explain the reason for me? Thanks a lot. -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message