From owner-freebsd-current@FreeBSD.ORG Tue Jan 13 23:31:14 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 078D0C5; Tue, 13 Jan 2015 23:31:14 +0000 (UTC) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87456DE2; Tue, 13 Jan 2015 23:31:13 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id w62so5786692wes.11; Tue, 13 Jan 2015 15:31:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=m4nrEqKx6eAYTP76ES9cJf2nGQLPIR2kuoB311vX1Z4=; b=EGdfCdkGZWnolusvIFSsEQ05N+ijUS2cyE/jdAajGI9BZKUsMNgWwvaWckBZLRFr+b 3/GeOen6jv2sTVDpIBP5/X25WY+PTutC8BPWr7SZA2Hk4hEkuvaml6MyBavHY3rAjPrG T9MyWLydI3J7Z+aQjc9P9v0ntmmZN3RXGOQtfQ3JIiCspS2Waaq5PszZ6o2u+ip5zSqa bIqKMQUeauVFV1pYwS3KHba/E1aVHDq1ud35nZ+rLJjcttxQ+Bkrku/0JpxlzSA/XK10 oIwGggTJ9aBwE64At30e1Bm2cDyhAJO883fapHYeI8TYrWddyCMSD7h983/d4cJ+WY6F 1rIQ== X-Received: by 10.180.93.1 with SMTP id cq1mr44125528wib.2.1421191872114; Tue, 13 Jan 2015 15:31:12 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id gu5sm16135251wib.24.2015.01.13.15.31.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 15:31:11 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 14 Jan 2015 00:31:09 +0100 From: Baptiste Daroussin To: Bryan Drewery Subject: Re: Devops question: freebsd-update needs a real tty to run, problem for automation Message-ID: <20150113233109.GI17273@ivaldir.etoilebsd.net> References: <54B5AA4C.7050307@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a7XSrSxqzVsaECgU" Content-Disposition: inline In-Reply-To: <54B5AA4C.7050307@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Craig Rodrigues , Ahmed Kamal , freebsd-current Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2015 23:31:14 -0000 --a7XSrSxqzVsaECgU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 13, 2015 at 05:29:16PM -0600, Bryan Drewery wrote: > On 1/13/2015 5:11 PM, Craig Rodrigues wrote: > > Hi, > >=20 > > Ahmed Kamal, a devops expert, is helping me to script the steps to > > upgrade a cluster of FreeBSD machines. For certain machines, > > we want to track the official FreeBSD releases and use freebsd-update > > to install official updates. > >=20 > > We found that when the invocation of freebsd-update was scripted > > and not run via a real tty, we can into this error: > >=20 > > "freebsd-update fetch should not be run non-interactively." > >=20 > > There are various workarounds mentioned on various web pages. > > However, should we modify freebsd-update so that it can work better > > when not run via a real tty? This would make it more devops/automation > > friendly. > >=20 > > The closest thing I have found is "freebsd-update cron", which can fetch > > the updates and run without a real tty. The only problem with > > "freebsd-update cron" > > is that it sleeps a random amount of time between 1 and 3600 seconds be= fore > > fetching the updates. This is OK when run in a cron job, > > but not OK when run as part of a devops automation framework. > >=20 > > Anybody have ideas as to the best way to proceed in fixing this in > > freebsd-update? > > -- > > Craig >=20 >=20 > sed -i '' -e 's,-t 0 ];,-t 0 ] \&\& [ 0 -eq 1 ],' /usr/sbin/freebsd-update >=20 > This is untested. We'll likely put it in Poudriere as well. >=20 > IMHO the check should be removed in the official version. >=20 You do not need it in poudriere as the rexec binary emulates a tty to worka= round this. Best regards, Bapt --a7XSrSxqzVsaECgU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlS1qroACgkQ8kTtMUmk6EwaVwCfesICx0LdDTgljkhLjr3+0pF1 N2gAnjMLnj1ms9hQI4bISlnnwzq43uFR =X5X7 -----END PGP SIGNATURE----- --a7XSrSxqzVsaECgU--