From owner-cvs-all Tue Apr 6 7:55:18 1999 Delivered-To: cvs-all@freebsd.org Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (Postfix) with ESMTP id 793C51569A; Tue, 6 Apr 1999 07:54:26 -0700 (PDT) (envelope-from brian@lan.awfulhak.org) Received: from keep.lan.Awfulhak.org (keep.lan.Awfulhak.org [172.16.0.8]) by awfulhak.org (8.9.2/8.9.2) with ESMTP id PAA06521; Tue, 6 Apr 1999 15:52:19 +0100 (BST) (envelope-from brian@lan.awfulhak.org) Received: from keep.lan.Awfulhak.org (localhost [127.0.0.1]) by keep.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id IAA74128; Tue, 6 Apr 1999 08:56:18 +0100 (BST) (envelope-from brian@keep.lan.Awfulhak.org) Message-Id: <199904060756.IAA74128@keep.lan.Awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Peter Wemm Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/cron/cron popen.c In-reply-to: Your message of "Mon, 05 Apr 1999 21:31:24 PDT." <199904060431.VAA10795@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 06 Apr 1999 08:56:17 +0100 From: Brian Somers Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > peter 1999/04/05 21:31:24 PDT > > Modified files: > usr.sbin/cron/cron popen.c > Log: > This is a hack. Cron runs with stdin/out/err pointing to /dev/console, > which init thoughtfully revoke()'s when starting a getty on ttyv0. This > Cron's popen() was passing these fd's through to cron children (ie: > sendmail, *not* normal cron jobs). The side effects were usually > not noticed, but it tripped up postfix which did a sanity check to see > that stdin/out/err were open, and got EBADF even thought the fd's were > in use. I seem to recall sendmail itself has hacks to work around > this problem, it had a checkfd012() function, possibly for this same > problem. (Postfix has a workaround too now though..) > > This is a hack, not a fix. It's probably best to check and perhaps > close/reopen() /dev/console if needed each time around the event loop. > It would probably be useful to actually see any error messages from cron. This isn't really correct either though. The descriptors could be revoked after cron execs. I would have thought there should be some way of revoking a terminals session and process group ids, resulting in the disassociation of all controlling processes, but *not* the revoke()ing of any descriptors. It could be used in place of revoke() for /dev/console (maybe settable in /etc/ttys). This would allow things like ``tail -f /dev/console'' to survive a console logout too. It sounds a bit hackish tough :-( -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message