From owner-freebsd-arch@freebsd.org Mon Jun 26 13:35:58 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 B4EE3D876ED for ; Mon, 26 Jun 2017 13:35:58 +0000 (UTC) (envelope-from jlehen@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 5EAAB79B71; Mon, 26 Jun 2017 13:35:58 +0000 (UTC) (envelope-from jlehen@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id w6so205072qtg.1; Mon, 26 Jun 2017 06:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ZLgjwTNYhvun57+HjuyJLRgGrSiuke1SwfuDEhjwtGo=; b=U0f83bjgtnjh/quzq+8qbUr/RKVHlbAsqGq6pm4tim/zJaS/5WwXd/lwACylqErlZK 9EUGv9xZMhKM9p0u949Wi84qlWL3c3+y8MpVTlHUQxDGAmq6otQIbbhGdtIgufoukvMu GgS6/OuN7sYiTrASZ0SsCIL/qfHod3eWBlbTw39KiaGicOqg6kkNjAhi/RxAuthlpZrq XhowLHp8bw+XLJUP12YqDaLpLxWvGoHXh8GtE/ezGQ8uncNvQ5fOaMND7VWNyd0CW1Hi crtWM1o5VUg5goGtI6+J8dpydp/10DQcDCn4k3HvPi8VZOYCQh+5LplH0ICQhMT5RNBD 0Ttg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ZLgjwTNYhvun57+HjuyJLRgGrSiuke1SwfuDEhjwtGo=; b=g+Yv33A7y+5xr6r9O/kqp+J1ZMoTrkSBmun4ml3uxgVpj9s+u0sW/cIT5fMlncB3eZ IJ/xj6R+ncaLMnEHOwo+Dxj8vmNHunBlyaCujpGOMVvtitPrK35yVHgOdLyKAW1Nhygi r9P1hiGS5XjlSbBuRPeqHWv6f6/62sE53TOGLZLODpFwaY65hQVmrE4ooOhj5TXiYEyk /NTrzUofmgelGkF6M85GgCBNdwxXPrla0v8LqwdLFGpzKgJUfF6tCyltACW/92OnpIzh IItaVQgSooy69US/ZAgU5oDdRa74wqcqEAymerd55bsaTJX73Ro5+K6hg2NJE5g2Yx44 oR5A== X-Gm-Message-State: AKS2vOz9nRvLQyT7IQbSIMOeRlC4XGQr606HamxZoLUJuIeezRl4mQGi sW6mNb1bzSteVZUgb6IUtTA2L+yFuvS0 X-Received: by 10.200.47.176 with SMTP id l45mr307429qta.153.1498484157255; Mon, 26 Jun 2017 06:35:57 -0700 (PDT) MIME-Version: 1.0 Sender: jlehen@gmail.com Received: by 10.12.181.46 with HTTP; Mon, 26 Jun 2017 06:35:56 -0700 (PDT) In-Reply-To: <20170626124348.GA11618@FreeBSD.org> References: <20170625130923.GD18123@zxy.spb.ru> <20170626124348.GA11618@FreeBSD.org> From: Jeremie Le Hen Date: Mon, 26 Jun 2017 15:35:56 +0200 X-Google-Sender-Auth: LfoEhT08GF4VtflXuVfkhOo9P98 Message-ID: Subject: Re: rtools were deemed almost unused 15 years ago... To: John Cc: Slawa Olhovchenkov , freebsd-arch@freebsd.org 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 13:35:58 -0000 On Mon, Jun 26, 2017 at 2:43 PM, 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... I don't have any context here. If you think it's the right thing to do, then go ahead and I will update the port tarball. > 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" -- Jeremie Le Hen jlh@FreeBSD.org