From owner-freebsd-current@FreeBSD.ORG Wed Jan 14 00:09:59 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03CA7544; Wed, 14 Jan 2015 00:09:59 +0000 (UTC) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (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 BE1C315A; Wed, 14 Jan 2015 00:09:58 +0000 (UTC) Received: by mail-ig0-f175.google.com with SMTP id h15so19907616igd.2; Tue, 13 Jan 2015 16:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FVs+li0ALdoGC719DYaYS+k0G002rL+37NElNNkZOPc=; b=hj2Ni7lOMnHJQGiUYT06+8xP4uGKUDSmkagLe2cJT2OOD1Mt5E/f16l6H6l7ShdeEF Q/VTPzwOHIZcYvACzaC0/Ql8z9PbsR9bslduc1Dd6Z5roQTC/ahtyZVREdO95riGW6q+ 6pkFw22fSvHsXYgpvMg9LDYb6WFktSTJs8k7IlA18M4qNiOanh6geqoda1eE3mdzbDYF gzyo1sSvF2uSphloCNAkxdCZDPI8dMSeB/o5deEPMapYg6AzOw71lNFBMACuVhRM1k2n Ke2du61rDr9+r2fGQwqFcDNsl1hz/v8/Va7/2ryeREXFkmxrVRHPipXR8mmnE5SCCnZ7 UuKw== MIME-Version: 1.0 X-Received: by 10.107.18.208 with SMTP id 77mr1163150ios.57.1421194197758; Tue, 13 Jan 2015 16:09:57 -0800 (PST) Received: by 10.50.225.141 with HTTP; Tue, 13 Jan 2015 16:09:57 -0800 (PST) In-Reply-To: <54B5AA4C.7050307@FreeBSD.org> References: <54B5AA4C.7050307@FreeBSD.org> Date: Tue, 13 Jan 2015 16:09:57 -0800 Message-ID: Subject: Re: Devops question: freebsd-update needs a real tty to run, problem for automation From: NGie Cooper To: Bryan Drewery Content-Type: text/plain; charset=UTF-8 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: Wed, 14 Jan 2015 00:09:59 -0000 On Tue, Jan 13, 2015 at 3:29 PM, Bryan Drewery wrote: > On 1/13/2015 5:11 PM, Craig Rodrigues wrote: >> Hi, >> >> 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. >> >> We found that when the invocation of freebsd-update was scripted >> and not run via a real tty, we can into this error: >> >> "freebsd-update fetch should not be run non-interactively." >> >> 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. >> >> 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 before >> fetching the updates. This is OK when run in a cron job, >> but not OK when run as part of a devops automation framework. >> >> Anybody have ideas as to the best way to proceed in fixing this in >> freebsd-update? >> -- >> Craig > > > sed -i '' -e 's,-t 0 ];,-t 0 ] \&\& [ 0 -eq 1 ],' /usr/sbin/freebsd-update > > This is untested. We'll likely put it in Poudriere as well. freebsd-update needs to grow a non-interactive option probably: 2375 read dummy