From owner-svn-src-all@freebsd.org Fri Sep 25 17:55:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E9D43FE976; Fri, 25 Sep 2020 17:55:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Byfhn5jYTz4KQB; Fri, 25 Sep 2020 17:55:37 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 08PHtZ97051624; Fri, 25 Sep 2020 10:55:35 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 08PHtZOs051623; Fri, 25 Sep 2020 10:55:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202009251755.08PHtZOs051623@gndrsh.dnsmgr.net> Subject: Re: svn commit: r365643 - head/bin/cp In-Reply-To: To: Kyle Evans Date: Fri, 25 Sep 2020 10:55:35 -0700 (PDT) CC: Stefan Esser , Warner Losh , "Rodney W. Grimes" , Alan Somers , Mateusz Guzik , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Byfhn5jYTz4KQB X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.57 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-0.22)[-0.219]; NEURAL_HAM_LONG(-0.10)[-0.100]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.01)[-0.011]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; FREEMAIL_CC(0.00)[freebsd.org,bsdimp.com,gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2020 17:55:38 -0000 > On Thu, Sep 24, 2020 at 3:08 AM Stefan Esser wrote: > > > > Am 24.09.20 um 08:54 schrieb Warner Losh: > > > > > > > > > On Thu, Sep 24, 2020 at 12:41 AM Stefan Esser > > > wrote: > > > > > > Am 23.09.20 um 19:23 schrieb Warner Losh> But for this issue, we're not > > > mounting devfs early enough. We should > > > > fix that. Removing /dev/null from the boot process likely is > > > never going > > > > to happen because we use it all over the place to discard output... > > > > There's ~200 instances of it in the boot rc scripts, so getting > > > rid of > > > > it there would also be quite the effort, with the same question. > > > > > > Removal of /dev/null from rc.d scripts should be quite simple, > > > since most cases could just use ">-" (close file descriptor) > > > instead. Other usage could be substituted with ":>" followed > > > by chown. > > > > > > > > > So closing fd1 and fd2 doesn't cause them to be available for these > > > programs to get as an fd on open, causing other issues? > > > > > > But >- isn't documented in sh(1) as doing the close thing. On a whim I > > > did the following: > > > $ echo fred >- > > > $ ls -last ./- > > > 4 -rw-r--r-- 1 imp imp 5 Sep 24 00:50 ./- > > > $ cat ./- > > > fred > > > $ > > > which suggests maybe you now have a lot of files named - instead... > > > > Yes, sorry, please ignore what I wrote - I was thinking of ">&-" of > > course, but that is not gracefully accepted by many commands (they > > are aborted when trying to write to the closed file descriptor). > > > > I had thought about piping into a command that ignores STDIN, first, > > e.g. "| :", but that generates a SIGPIPE when trying to flush the > > FILE buffer (i.e. after 4 KB, which might be sufficient for most > > cases, but it is not a general solution). > > > > A program that reads from STDIN and generates no output could be used, > > though, e.g. "| sed d". > > > > But this would cause lots of extra forked processes and increase the > > start-up time and is not acceptable. > > > > > but e.g. rc.d/syscons > > > uses ${kbddev} (i.e. /dev/ttyv0) and rc.d/zvol performs swapon > > > on /dev/zvol/${name}, rc.d/random uses /dev/random and so on. > > > > > > So those interactions should be disaled by rc variables... Or we should > > > be failing the operation... > > > > Going multi-user should not be stopped by any of the rc scripts > > failing due to lack of /dev. But since most developers will only > > test with /dev available, there is a risk that changes to rc files > > will not gracefully handle a missing /dev. > > > > I was under the impression from previous reading and kib's response > that this is a complete non-issue, there's no way you can go > multi-user without a mounted /dev and we go to somewhat great lengths > to make sure we're good. Though kib can assert that, it does not change the fact that I frequently find /dev/null FILES on unmounted root file systems. But lets not mix the 2 separate things of boot time /dev dependency and build time /dev dependency. > > I agree with the previous goal of ripping the /dev dependency out of > the build, but this is also much, much easier said than done. > So we agree that it might be a good idea to reduce /dev dependency in the build process. -- Rod Grimes rgrimes@freebsd.org