Date: Tue, 06 Apr 1999 08:56:17 +0100 From: Brian Somers <brian@Awfulhak.org> To: Peter Wemm <peter@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/cron/cron popen.c Message-ID: <199904060756.IAA74128@keep.lan.Awfulhak.org> In-Reply-To: Your message of "Mon, 05 Apr 1999 21:31:24 PDT." <199904060431.VAA10795@freefall.freebsd.org>
index | next in thread | previous in thread | raw e-mail
> 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 <brian@Awfulhak.org> <brian@FreeBSD.org> <brian@OpenBSD.org>
<http://www.Awfulhak.org>
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904060756.IAA74128>
