From owner-freebsd-arch@freebsd.org Mon Jun 26 16:34:31 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 3FEDED8BAB9 for ; Mon, 26 Jun 2017 16:34:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C88E47FA79; Mon, 26 Jun 2017 16:34:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wr0-x243.google.com with SMTP id x23so29804415wrb.0; Mon, 26 Jun 2017 09:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+Kc90a6Yl3UD/dd++ppxFYVGiXfWgLm5pobrkFya09g=; b=EgWxmkWA7z7maqbgxHE8ol6QvXjm1juTb5/hAY4JhWjP1bOKurkJAiGck110wyBor4 J5vpxRpOFMYcqjiHOee9SDLJ3PWY2vbxbcz1RnjiJRv9k7pOTUs2cr8qAspVFbltRowW hm/ExorOUxwDnZyIFE7S1CAWDds7sEoqF5hUrhilss7kWfR94mkuzrJtn68FjocayZrO /zHXOLyNuWDvpn6QmSjYXLtGbxSHyN8F5dbGuiJNM0DJ+1D6AZxDb4lnSsnsSpvJIQU+ ciASFNuCl2+ytZKoUK0B/6uADDZ/Od2/S54prpeXgbYV9VWvwsaREVV0L/UjakJqzurV dEzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+Kc90a6Yl3UD/dd++ppxFYVGiXfWgLm5pobrkFya09g=; b=pgm0kOfdAD6oZK/sJc5EVtibObhPogu1mv0C6KVmVC6Kx4b0QolODQmJhLvkXFGDDz dqFT3mlmorFItj+V37dcCAwJD1tcbR6u1CKaVbavwnymJBjxEN+Op6gR0xkFO4fL3Ui4 trB2DMsAqro92D7JD5qgaSG4xpezBtgeCIMOje44qxeVuwTk6yYNBYpLGBcCb5Xql8Pu 5oPxgFtj1kN320wcFGkgJ64uMMZXV5uY3c8cdTHdyIealzrs2w8KI+jyLB1ZLbD7byf9 ZyaoArOd3zzIHLOcw0tm+T7zOWHGJm43Lpo6EdJSeKJBH/gPJYXC8fZNAlIw+4UhH1xk IiOQ== X-Gm-Message-State: AKS2vOyT6bJL+R+82irxUSFKS+HenPzlBcX1Ek7kVhAlJKVdzk2wpGGx 8l25Vc0iZZ7cMShthGBSWYgoKBN+8P5o X-Received: by 10.223.171.25 with SMTP id q25mr15470283wrc.89.1498494868989; Mon, 26 Jun 2017 09:34:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.183.138 with HTTP; Mon, 26 Jun 2017 09:34:28 -0700 (PDT) In-Reply-To: <20170626124348.GA11618@FreeBSD.org> References: <20170625130923.GD18123@zxy.spb.ru> <20170626124348.GA11618@FreeBSD.org> From: Adrian Chadd Date: Mon, 26 Jun 2017 09:34:28 -0700 Message-ID: Subject: Re: rtools were deemed almost unused 15 years ago... To: John Cc: Jeremie Le Hen , "freebsd-arch@freebsd.org" , Slawa Olhovchenkov Content-Type: text/plain; charset="UTF-8" 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 16:34:31 -0000 Oh holy crap yes please. Do you have commit privs to src? If not, Reviewed by: adrian -adrian On 26 June 2017 at 05:43, John wrote: > ----- Jeremie Le Hen's Original Message ----- >> On Sun, Jun 25, 2017 at 3:09 PM, Slawa Olhovchenkov wrote: >> > 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. >> >> 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 > =================================================================== > --- 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 = 1; > const char *cp, *errorstr; > char sig, buf[BUFSIZ]; > @@ -496,8 +496,7 @@ > #ifdef USE_BLACKLIST > blacklist(0, STDIN_FILENO, "success"); > #endif > - for (fd = getdtablesize(); fd > 2; fd--) > - (void) close(fd); > + closefrom(3); > if (setsid() == -1) > syslog(LOG_ERR, "setsid() failed: %m"); > if (setlogin(pwd->pw_name) < 0) > > Cheers, > John > >> -- >> 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"