From owner-freebsd-hackers Mon Sep 13 13:50: 6 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bantu.cl.msu.edu (bantu.cl.msu.edu [35.8.3.18]) by hub.freebsd.org (Postfix) with ESMTP id 412D615121 for ; Mon, 13 Sep 1999 13:50:02 -0700 (PDT) (envelope-from dervish@bantu.cl.msu.edu) Received: (from dervish@localhost) by bantu.cl.msu.edu (8.9.3/8.9.3) id QAA48611; Mon, 13 Sep 1999 16:49:16 -0400 (EDT) (envelope-from dervish) Date: Mon, 13 Sep 1999 16:49:15 -0400 From: bush doctor To: Zhihui Zhang Cc: "Brian Mitchell (ISSATL)" , freebsd-hackers@FreeBSD.ORG Subject: Re: Let a daemon process print a message Message-ID: <19990913164915.A44185@bantu.cl.msu.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: ; from Zhihui Zhang on Mon, Sep 13, 1999 at 04:12:44PM -0400 X-Operating-System: FreeBSD 4.0-CURRENT i386 X-PGP-Fingerprint: 35 95 F8 63 DA 5B 32 51 8F A9 AC 3C B4 74 F3 BA WWW-Home-Page: http://www.msu.edu/~ikhala Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Out of da blue Zhihui Zhang aka (zzhang@cs.binghamton.edu) said: > > 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. Did you add an entry in /etc/syslog.conf for your daemon? If not check the man page for syslog.conf(5) for details ... > > -Zhihui > > #:^) -- So ya want ta here da roots? Dem that feels it knows it ... bush doctor To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message