From owner-freebsd-current@FreeBSD.ORG Sun Jan 25 07:41:50 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 0E6A0D78; Sun, 25 Jan 2015 07:41:50 +0000 (UTC) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::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 81B03FA8; Sun, 25 Jan 2015 07:41:49 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id b6so3470852lbj.11; Sat, 24 Jan 2015 23:41:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+AbjC8mDY9nmVhfGeDTjcu3SpZsTxXrUIpxHGc5Ifmo=; b=DgYxKdXCXxmMat7ZzG62pgonSX2OKGCSrhS+8k/Tydxz+jTXEESw94nvEa9e1z2Zrx of1+LwuGWXVmZtNyPzyCvnQlKgW7LnYevJMLCM6j7lF6wlKtfp2lW2r8lptiKh7DnCiF 756mDwo/6yGbc/gaHUnLNEM82gDuH/mESA+i7YnlWRnJJfLxaz04itUgKsYcAfC5IwGG yksdl6LK4LwVJgCaDEAOXrV6TwMhfLHHHWkXGtcptFbYVBvah9zZBXI/yzMPtsNgBu0q j8Y1kHUTMMhCFxKuvV9MKJ7bRiAoZp+/oAf/PcNygEgE25medkqNX314vALPNPH3JHKZ EJQQ== MIME-Version: 1.0 X-Received: by 10.112.44.230 with SMTP id h6mr15401923lbm.98.1422171707418; Sat, 24 Jan 2015 23:41:47 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.129.3 with HTTP; Sat, 24 Jan 2015 23:41:47 -0800 (PST) In-Reply-To: <54B5B4EF.3010109@freebsd.org> References: <54B5B4EF.3010109@freebsd.org> Date: Sat, 24 Jan 2015 23:41:47 -0800 X-Google-Sender-Auth: Z-ZIGuzar5d1oqAepZ1tY8OdQUA Message-ID: Subject: Re: Devops question: freebsd-update needs a real tty to run, problem for automation From: Craig Rodrigues To: Allan Jude Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: 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: Sun, 25 Jan 2015 07:41:50 -0000 On Tue, Jan 13, 2015 at 4:14 PM, Allan Jude wrote: > On 2015-01-13 18:11, 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 > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to " > freebsd-current-unsubscribe@freebsd.org" > > > > I think this requirement was originally added when Colin hosted the > mirrors for FreeBSD update himself, and was worried about everyone > scripting it to run via crontab at midnight every night. > > It is likely a false requirement, and can be safely removed. > > Dealing with the merges, only really affects version upgrades, and is > less of an issue compared to being able to automate security fixes. > Hi, I submitted this review: https://reviews.freebsd.org/D1665 to remove the check for an interactive tty in "freebsd-update fetch". Being able to run "freebsd-update fetch" via automation will make it much more convenient to update clusters of FreeBSD nodes. -- Craig