From owner-freebsd-arch@freebsd.org Mon Jun 26 12:43:49 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7546DA9E0F for ; Mon, 26 Jun 2017 12:43:49 +0000 (UTC) (envelope-from jwd@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3780779A0; Mon, 26 Jun 2017 12:43:49 +0000 (UTC) (envelope-from jwd@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 821) id 059B2F138; Mon, 26 Jun 2017 12:43:49 +0000 (UTC) Date: Mon, 26 Jun 2017 12:43:48 +0000 From: John To: Jeremie Le Hen Cc: Slawa Olhovchenkov , freebsd-arch@freebsd.org Subject: Re: rtools were deemed almost unused 15 years ago... Message-ID: <20170626124348.GA11618@FreeBSD.org> References: <20170625130923.GD18123@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 12:43:49 -0000 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable ----- Jeremie Le Hen's Original Message ----- > On Sun, Jun 25, 2017 at 3:09 PM, Slawa Olhovchenkov wrot= e: > > On Sat, Jun 24, 2017 at 10:29:22PM +0200, Jeremie Le Hen wrote: > > > >> So the first step was to create a port with FreeBSD rcmds, here we > >> are! But I need some eyes to vet it: > >> https://reviews.freebsd.org/D11345 > > > > 1. Create port > > 2. Port unmantained > > 3. Port broken > > 4. Port removed. > > 5. Lack of functionality. >=20 > Feel free to step in to help with the maintenance :-). Let's commit this little snippet which is a major win for HA heads with 10 of thousands of file descriptors open... Index: libexec/rshd/rshd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- libexec/rshd/rshd.c (revision 316672) +++ libexec/rshd/rshd.c (working copy) @@ -191,7 +191,7 @@ struct passwd *pwd; u_short port; fd_set ready, readfrom; - int cc, fd, nfd, pv[2], pid, s; + int cc, nfd, pv[2], pid, s; int one =3D 1; const char *cp, *errorstr; char sig, buf[BUFSIZ]; @@ -496,8 +496,7 @@ #ifdef USE_BLACKLIST blacklist(0, STDIN_FILENO, "success"); #endif - for (fd =3D getdtablesize(); fd > 2; fd--) - (void) close(fd); + closefrom(3); if (setsid() =3D=3D -1) syslog(LOG_ERR, "setsid() failed: %m"); if (setlogin(pwd->pw_name) < 0) Cheers, John > --=20 > Jeremie Le Hen > jlh@FreeBSD.org > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQF8BAEBCgBmBQJZUQGEXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwNDBGOTgxNzM0NzQ3OEFBNDYyODNGQzVC NjI0OTlBMTQyNEY3RjgxAAoJELYkmaFCT3+BYkEIAIBroqvSXOfP2s98/1+ZkCJg wgE7KxXP4FuPIahYB+gVUT/icY8PVD9yYHU5K28cf6+l8Jx2jeVBXMMPbhMtzk6R own4/na4RzJ5cxAHMpKzleO4UcaKWo0DWOcetB3CMts3Fy2YqGxc92qcHbTyoEeH DRLI7OYtg0h3spOAQJGBhZ7YcVvay+FIZDIlxx3qXESFCAiyhw4I9ZgrRN6WpHzP qZClJVmSfw3EuREd6o9pFyVyE5XnYUX1ddA1wIViEifh0GxG8RIkGHNI9YNWKdpx D2nd3jtDjdVpGaA/Un+u6ZHWb0pjVRyk3WKWzXCIcr0PqaEdPyE/XNdUT0Ic8iU= =XAH3 -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--