Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2015 17:29:16 -0600
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>, freebsd-current Current <freebsd-current@freebsd.org>
Cc:        Ahmed Kamal <email.ahmedkamal@googlemail.com>
Subject:   Re: Devops question: freebsd-update needs a real tty to run, problem for automation
Message-ID:  <54B5AA4C.7050307@FreeBSD.org>
In-Reply-To: <CAG=rPVcLWgXR_7JabjbkCWK=SkrQrgcZmAS=Yde0mE3Qpz8Q=A@mail.gmail.com>
References:  <CAG=rPVcLWgXR_7JabjbkCWK=SkrQrgcZmAS=Yde0mE3Qpz8Q=A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--hs0FIiMpUkuQ2RG7ECI5t8q70qAVdTxE0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

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 fetc=
h
> 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


sed -i '' -e 's,-t 0 ];,-t 0 ] \&\& [ 0 -eq 1 ],' /usr/sbin/freebsd-updat=
e

This is untested. We'll likely put it in Poudriere as well.

IMHO the check should be removed in the official version.

--=20
Regards,
Bryan Drewery


--hs0FIiMpUkuQ2RG7ECI5t8q70qAVdTxE0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUtapMAAoJEDXXcbtuRpfP6CsH/AxX0kNQJTcm09+gHBw8tNxi
L2SwgqF1LLDpcmJJXqVnnARu719BRpprV6Dhu+i+WOsXv9WQTVVapwMpPuP3d9/v
HJj4AYauo4KyfGFVemcWdgs8BC0+g5DdDUga9CxWIdas2zqr86GF8osZoO3tPiNH
hasA2wkA+foqPY98hLNOAPzp1wVp8ewr6mq+K1wCA0Nihsg5P1ZAIN1jZ6yYCfv3
ASXDnipWCfuf8Y+10uizcCAv8LHirLK095wd0b48VtzDyxDckwuB3jfvfS9VP5nx
ehIAJ0NoaoyTEieTjrKSwG1qFJ29pJLkTTSqr5gpvpwy5QzC4o4NFCcG4tz6HF8=
=QQrZ
-----END PGP SIGNATURE-----

--hs0FIiMpUkuQ2RG7ECI5t8q70qAVdTxE0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54B5AA4C.7050307>