From owner-freebsd-ports@FreeBSD.ORG Mon Aug 16 11:02:32 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34741065674 for ; Mon, 16 Aug 2010 11:02:31 +0000 (UTC) (envelope-from jyoti.mickey@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id A3B3E8FC0C for ; Mon, 16 Aug 2010 11:02:31 +0000 (UTC) Received: by qwg5 with SMTP id 5so5552135qwg.13 for ; Mon, 16 Aug 2010 04:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=riVaIQVQjM/mcmimqAk0Lb8BITAprilUtUSt2qXQ/Gg=; b=X/WQncEhgWJKpImCvB3pkZD/mtKt78kPjWbFGkLxy5Oc7AmF41w6PZCxJuwU3QglOg LvisskWDW4TIQssQIEYwf/xWoFlD7aIYRuVo6aIrifKXeeeyc3r5OzIU+QC/FvEu7/uL zGyqva6AwBZSYG/zyNGVWfiF6OhJlD1UG9pMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gDnS1kYO/s6YaYjjQ9WVWlBN+9PS7ZZxPdaX0KOP17/H8BluQIxdQQY+a8B27K4fcw dCOTk4kahr7owDg1J6JojW/9PCjFWshW6L2td27kxMZAioM4HI1CA8tLisxcqvpi8K2S U3sGMGgQd0dQJrilWTuBFuvQ7rezY1ml5FC6k= MIME-Version: 1.0 Received: by 10.224.2.147 with SMTP id 19mr3164702qaj.60.1281955070735; Mon, 16 Aug 2010 03:37:50 -0700 (PDT) Received: by 10.229.29.131 with HTTP; Mon, 16 Aug 2010 03:37:50 -0700 (PDT) In-Reply-To: <20100816054932.GD1553@albert.catwhisker.org> References: <20100816054932.GD1553@albert.catwhisker.org> Date: Mon, 16 Aug 2010 16:07:50 +0530 Message-ID: From: Jyoti Sharma To: David Wolfskill Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-ports@freebsd.org Subject: Re: It's annoying when something other than rsyncd listens on tco/873 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2010 11:02:32 -0000 I would prefer this approach: amd.conf has the option preferred_amq_port to specify the listening port. Don't know about ypbind. It is not just rsyncd that can get disturbed. Grabbing arbitrary port without consulting /etc/services and the startup scripts is a bad idea for any service. bindresvport() is at the bottom of the problem and there seems to be no readily available workaround. There is a portreserve tool in debian to avoid such situation. Don't know if we have an equivalent in FreeBSD. Regards, Jyoti On 16 August 2010 11:19, David Wolfskill wrote: > > My build machine is noisy & generates heat, so I leave it powered off > when it's not actively in use. > > As a consequence, it gets rebooted rather often. > > It is configured to run rsyncd(8) so I can update my laptop's local mirro= r > of the FreeBSD SVN repository. > > A couple of mornings ago, I woke up, ready to start my daily builds (on > the laptop & build machine), but noticed that the SVN mirror on the > laptop hadn't been updated. =A0Eventually, I discovered that the reason > was that amd(8) [on the build machine] was listening on 873/tcp, which > is the port for rsync. =A0I restarted amd(8); it happened to get other > ports, so I restarted rsyncd(8), and was able to perfomr the mirroring. > > Mind, that was the first time since around February that I've had a > problem with using rsyncd(8) in this fashion. > > Since then, I've become a bit ... sensitized .... to the issue, so a > quick "sockstat -4l" immediately after powering it on helps avoid ths > sort of thing. > > So this evening, such a check showed that ypbind(8) was listening on > 873/tcp. > > The most straightforward way to make this a non-issue (it seems to me) > would be to start rsyncd(8) before other services that grab arbitrary > ports; however, the start-up script for rsyncd s[ecifies: > > # PROVIDE: rsyncd > # REQUIRE: LOGIN > # BEFORE: =A0securelevel > # KEYWORD: shutdown > > and both amd & ypbind specify > > # BEFORE: =A0DAEMON > > so that approach doesn't seem to quite work out. > > (I note that I recently stopped tracking stable/7 on the build machine, > so I now boot into stable/8; perhaps something changed between stable/7 > and stable/8 that inicreases the probability of such an unfortunate > collsion.) > > Also, rsyncd(8) doesn't appear to consider this a condition worthy of > note -- at least, I wasn't able to find any whines, and the daemon was > still running. > > Anyone have suggestions for avoiding a recurrence (vs. working around > the coiindition should one occur)? > > Thanks! > > Peace, > david > -- > David H. Wolfskill =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0david@catwhisker.org > Depriving a girl or boy of an opportunity for education is evil. > > See http://www.catwhisker.org/~david/publickey.gpg for my public key.