From owner-freebsd-current Thu Nov 18 7: 1:20 1999 Delivered-To: freebsd-current@freebsd.org Received: from overcee.netplex.com.au (overcee.netplex.com.au [202.12.86.7]) by hub.freebsd.org (Postfix) with ESMTP id 55549153FE for ; Thu, 18 Nov 1999 07:01:12 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id D2A7B1CA0; Thu, 18 Nov 1999 23:01:10 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.0.2 2/24/98 To: Luoqi Chen Cc: current@freebsd.org Subject: Re: init runs with console as control terminal? In-reply-to: Your message of "Wed, 17 Nov 1999 22:57:02 EST." <199911180357.WAA18909@lor.watermarkgroup.com> Date: Thu, 18 Nov 1999 23:01:10 +0800 From: Peter Wemm Message-Id: <19991118150110.D2A7B1CA0@overcee.netplex.com.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Luoqi Chen wrote: > Since sometime last month, rc5des failed to start from my rc.local. I did > a little investigation and it turned out that rc5des was started but later > terminated by a SIGHUP. During its brief lifetime, /dev/console was its > control terminal. Does anyone know what was going on? Something is revoking /dev/console, most of the time, but it varies. Other times, you get garbage when /etc/rc exits (when using a serial console). For example, run from rc.d: 336 con- I+ 0:00.01 /bin/sh /usr/local/bin/safe_mysqld --user=mysql 355 con- S+ 0:00.04 /usr/local/libexec/mysqld --basedir=/usr/local --data ^^^^ revoke(2)ed. This is a plain syscons boot, nothing special, didn't go into single user. syslog(3) also suffers as a result of this - it closes and reopens /dev/ console to get around it when asked to do LOG_CONS. fstat(2) on the fd to /dev/console returns EBADF. This broke postfix too. Each time I raised the issue, bde told me it wasn't happening. But *something* is revoking /dev/console, either directly or via a revoke on /dev/ttyv0: pwroot@overcee[10:50pm]~-104# fstat | grep none root sh 336 2 - - none - root cron 218 0 - - none - root cron 218 1 - - none - root cron 218 2 - - none - root syslogd 145 8 - - none - root adjkerntz 40 0 - - none - root adjkerntz 40 1 - - none - root adjkerntz 40 2 - - none - pwroot@overcee[10:59pm]~ports/sysutils/lsof-111# lsof | grep revoke adjkerntz 40 root 0u VBAD (revoked) adjkerntz 40 root 1u VBAD (revoked) adjkerntz 40 root 2u VBAD (revoked) syslogd 145 root 8w VBAD (revoked) cron 218 root 0u VBAD (revoked) cron 218 root 1u VBAD (revoked) cron 218 root 2u VBAD (revoked) sh 336 root 2u VBAD (revoked) init(8) does a revoke on /dev/ttyv0 after /etc/rc finishes and before the ttyv0 getty fires up, so I suspect an aliasing problem, but I can't see what's doing it. (I haven't been annoyed enough to find out what's really happening) Oh, also, the rc5des client has changed over the last few months. I found I had to change it's startup method a few times. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message