• Re: Non-interactive run of `freebsd-update upgrade` possible?

    From Ronald Klop@ronald-lists@klop.ws to muc.lists.freebsd.stable on Thu Jul 31 15:31:51 2025
    From Newsgroup: muc.lists.freebsd.stable

    ------=_Part_7471_185838132.1753968711941
    Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable

    Hi,

    Did you check freebsd-rustdate from ports/pkg? It uses the same servers, bu=
    t is faster and a bit more user friendly IMHO.=20
    Didn=E2=80=99t test your exact use case though.


    Regards,
    Ronald.=20

    Van: "Patrick M. Hausen" <hausen@punkt.de>
    Datum: 31 juli 2025 13:10
    Aan: Freebsd Stable <freebsd-stable@freebsd.org>
    Onderwerp: Non-interactive run of `freebsd-update upgrade` possible?

    =20
    =20
    Hi all,
    =20
    It's time to upgrade our ~100 hosts - again - and I would really
    like to at least partly automate the procedure.
    =20
    Current issue is that this sequence:
    =20
    freebsd-update upgrade -r 14.3 -b /tmp/be_mount.EkJx
    freebsd-update install -b /tmp/be_mount.EkJx
    freebsd-update install -b /tmp/be_mount.EkJx
    =20
    in my experience insists on asking "Does this look reasonable? (y/n)" interactively.
    =20
    And no version of
    =20
    export ASSUME_ALWAYS_YES=3Dyes
    =20
    or
    =20
    --not-running-from-cron
    =20
    seems to change that.
    =20
    Am I missing anything? I mean, after updating a handful of test
    systems - and especially when upgrading into a new BE -
    it should be possible to just rollout the new release via Ansible.
    =20
    Thanks and kind regards,
    Patrick
    --=20
    punkt.de GmbH
    Patrick M. Hausen
    .infrastructure
    =20
    Sophienstr. 187
    76185 Karlsruhe
    =20
    Tel. +49 721 9109500
    =20
    https://infrastructure.punkt.de
    info@punkt.de
    =20
    AG Mannheim 108285
    Gesch=C3=A4ftsf=C3=BChrer: Daniel Lienert, Fabian Stein
    =20
    =20
    =20
    =20
    =20
    ------=_Part_7471_185838132.1753968711941
    Content-Type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <html><head></head><body>Hi,<div><br></div><div>Did you check freebsd-rustd= ate from ports/pkg? It uses the same servers, but is faster and a bit more = user friendly IMHO.&nbsp;</div><div><div>Didn=E2=80=99t test your exact use=
    case though.<br><div><br></div><div>Regards,</div><div>Ronald.&nbsp;</div>= <div><br><p><small><strong>Van:</strong> "Patrick M. Hausen" &lt;hausen@pun= kt.de&gt;<br><strong>Datum:</strong> 31 juli 2025 13:10<br><strong>Aan:</st= rong> Freebsd Stable &lt;freebsd-stable@freebsd.org&gt;<br><strong>Onderwer= p:</strong> Non-interactive run of `freebsd-update upgrade` possible?<br></= small></p><blockquote style=3D"margin-left: 5px; border-left: 3px solid #cc=
    c; margin-right: 0px; padding-left: 5px;"><div class=3D"MessageRFC822Viewer=
    do_not_remove" id=3D"P"><!-- P -->
    <!-- processMimeMessage --><div class=3D"TextPlainViewer do_not_remove" id= =3D"P.P"><!-- P.P -->Hi all,<br>

    It's time to upgrade our ~100 hosts - again - and I would really<br>
    like to at least partly automate the procedure.<br>

    Current issue is that this sequence:<br>

    &nbsp;&nbsp;&nbsp;&nbsp;freebsd-update upgrade -r 14.3 -b /tmp/be_mount.EkJ= x<br>
    &nbsp;&nbsp;&nbsp;&nbsp;freebsd-update install -b /tmp/be_mount.EkJx<br> &nbsp;&nbsp;&nbsp;&nbsp;freebsd-update install -b /tmp/be_mount.EkJx<br>

    in my experience insists on asking "Does this look reasonable? (y/n)"<br> interactively.<br>

    And no version of<br>

    &nbsp;&nbsp;&nbsp;&nbsp;export ASSUME_ALWAYS_YES=3Dyes<br>

    or<br>

    &nbsp;&nbsp;&nbsp;&nbsp;--not-running-from-cron<br>

    seems to change that.<br>

    Am I missing anything? I mean, after updating a handful of test<br>
    systems - and especially when upgrading into a new BE -<br>
    it should be possible to just rollout the new release via Ansible.<br>

    Thanks and kind regards,<br>
    Patrick<br>
    --&nbsp;<br>
    punkt.de GmbH<br>
    Patrick M. Hausen<br>
    .infrastructure<br>

    Sophienstr. 187<br>
    76185 Karlsruhe<br>

    Tel. +49 721 9109500<br>

    <a href=3D"https://infrastructure.punkt.de">https://infrastructure.punkt.de= </a><br>
    info@punkt.de<br>

    AG Mannheim 108285<br>
    Gesch=C3=A4ftsf=C3=BChrer: Daniel Lienert, Fabian Stein<br>

    </div><!-- TextPlainViewer -->

    </div><!-- MessageRFC822Viewer --> </blockquote><br><br><br></div></div></div></body></html> ------=_Part_7471_185838132.1753968711941--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From vermaden@vermaden@interia.pl to muc.lists.freebsd.stable on Thu Jul 31 15:53:13 2025
    From Newsgroup: muc.lists.freebsd.stable

    --=-8ADb99SqJX7eFMdNINO7
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Hi,the only 'workaround' I know is this:# yes | env PAGER=3Dcat freebsd-upd= ate fetch&nbsp; &nbsp;--not-running-from-cron# yes | env PAGER=3Dcat freebs= d-update install --not-running-from-cronRegards,vermadenTemat: Non-interact= ive run of `freebsd-update upgrade` possible?Data: 2025-07-31 13:10Nadawca:=
    "Patrick M. Hausen" &lt;hausen@punkt.de&gt;Adresat: "Freebsd Stable" &lt;f= reebsd-stable@freebsd.org&gt;; &gt; Hi all,
    &gt;=20
    &gt; It's time to upgrade our ~100 hosts - again - and I would really
    &gt; like to at least partly automate the procedure.
    &gt;=20
    &gt; Current issue is that this sequence:
    &gt;=20
    &gt; freebsd-update upgrade -r 14.3 -b /tmp/be_mount.EkJx
    &gt; freebsd-update install -b /tmp/be_mount.EkJx
    &gt; freebsd-update install -b /tmp/be_mount.EkJx
    &gt;=20
    &gt; in my experience insists on asking "Does this look reasonable? (y/n)"
    &gt; interactively.
    &gt;=20
    &gt; And no version of
    &gt;=20
    &gt; export ASSUME_ALWAYS_YES=3Dyes
    &gt;=20
    &gt; or
    &gt;=20
    &gt; --not-running-from-cron
    &gt;=20
    &gt; seems to change that.
    &gt;=20
    &gt; Am I missing anything? I mean, after updating a handful of test
    &gt; systems - and especially when upgrading into a new BE -
    &gt; it should be possible to just rollout the new release via Ansible.
    &gt;=20
    &gt; Thanks and kind regards,
    &gt; Patrick
    &gt; --=20
    &gt; punkt.de GmbH
    &gt; Patrick M. Hausen
    &gt; .infrastructure
    &gt;=20
    &gt; Sophienstr. 187
    &gt; 76185 Karlsruhe
    &gt;=20
    &gt; Tel. +49 721 9109500
    &gt;=20
    &gt; https://infrastructure.punkt.de
    &gt; info@punkt.de
    &gt;=20
    &gt; AG Mannheim 108285
    &gt; Gesch=C3=A4ftsf=C3=BChrer: Daniel Lienert, Fabian Stein
    &gt;=20
    &gt;=20=

    --=-8ADb99SqJX7eFMdNINO7
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w= 3.org/TR/REC-html40/loose.dtd">
    <html><body><div data-select-link-text=3D"1">Hi,<br><br>the only 'workaroun=
    d' I know is this:<br><br><span style=3D"font-family: courier new, courier;=
    " data-mce-style=3D"font-family: courier new, courier;"># yes | env PAGER= =3Dcat freebsd-update fetch=C2=A0 =C2=A0--not-running-from-cron</span><br><= br><span style=3D"font-family: courier new, courier;" data-mce-style=3D"fon= t-family: courier new, courier;"># yes | env PAGER=3Dcat freebsd-update ins= tall --not-running-from-cron</span><br><br><br><br><br>Regards,<br>vermaden= <br><br><br><br><div class=3D"inpl-collapsed">Temat: Non-interactive run of=
    `freebsd-update upgrade` possible?<br>Data: 2025-07-31 13:10<br>Nadawca: "= Patrick M. Hausen" &lt;hausen@punkt.de&gt;<br>Adresat: "Freebsd Stable" &lt= ;freebsd-stable@freebsd.org&gt;; <br><br><blockquote style=3D"margin: 0; pa= dding-left: 1ex; border-left: 1px solid#CCC;" data-mce-style=3D"margin: 0; = padding-left: 1ex; border-left: 1px solid#CCC;"><pre>&gt; Hi all,
    &gt;=20
    &gt; It's time to upgrade our ~100 hosts - again - and I would really
    &gt; like to at least partly automate the procedure.
    &gt;=20
    &gt; Current issue is that this sequence:
    &gt;=20
    &gt; freebsd-update upgrade -r 14.3 -b /tmp/be_mount.EkJx
    &gt; freebsd-update install -b /tmp/be_mount.EkJx
    &gt; freebsd-update install -b /tmp/be_mount.EkJx
    &gt;=20
    &gt; in my experience insists on asking "Does this look reasonable? (y/n)"
    &gt; interactively.
    &gt;=20
    &gt; And no version of
    &gt;=20
    &gt; export ASSUME_ALWAYS_YES=3Dyes
    &gt;=20
    &gt; or
    &gt;=20
    &gt; --not-running-from-cron
    &gt;=20
    &gt; seems to change that.
    &gt;=20
    &gt; Am I missing anything? I mean, after updating a handful of test
    &gt; systems - and especially when upgrading into a new BE -
    &gt; it should be possible to just rollout the new release via Ansible.
    &gt;=20
    &gt; Thanks and kind regards,
    &gt; Patrick
    &gt; --=20
    &gt; punkt.de GmbH
    &gt; Patrick M. Hausen
    &gt; .infrastructure
    &gt;=20
    &gt; Sophienstr. 187
    &gt; 76185 Karlsruhe
    &gt;=20
    &gt; Tel. +49 721 9109500
    &gt;=20
    &gt; https://infrastructure.punkt.de
    &gt; info@punkt.de
    &gt;=20
    &gt; AG Mannheim 108285
    &gt; Gesch=C3=A4ftsf=C3=BChrer: Daniel Lienert, Fabian Stein
    &gt;=20
    &gt; </pre><br></blockquote><br><br></div></div><style type=3D"text/css">#i= cselection13 {width: 100% !important; height: 100% !important; padding-top:=
    0px !important; overflow: visible !important;}</style><style type=3D"text/= css">#icselection13 {width: 100% !important; height: 100% !important; paddi= ng-top: 0px !important; overflow: visible !important;}</style><style type= =3D"text/css">#icselection13 {width: 100% !important; height: 100% !importa= nt; padding-top: 0px !important; overflow: visible !important;}</style><sty=
    le type=3D"text/css">#icselection13 {width: 100% !important; height: 100% != important; padding-top: 0px !important; overflow: visible !important;}</sty= le><style type=3D"text/css">#icselection13 {width: 100% !important; height:=
    100% !important; padding-top: 0px !important; overflow: visible !important= ;}</style><style type=3D"text/css">#icselection13 {width: 100% !important; = height: 100% !important; padding-top: 0px !important; overflow: visible !im= portant;}</style><style type=3D"text/css">#icselection13 {width: 100% !impo= rtant; height: 100% !important; padding-top: 0px !important; overflow: visi= ble !important;}</style></body></html>

    --=-8ADb99SqJX7eFMdNINO7--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From vermaden@vermaden@interia.pl to muc.lists.freebsd.stable on Thu Jul 31 18:35:18 2025
    From Newsgroup: muc.lists.freebsd.stable

    Hi,

    I will reply again w/o HTML to make this more readable ...

    The only 'workaround' I know is this:

    # yes | env PAGER=cat freebsd-update fetch --not-running-from-cron

    # yes | env PAGER=cat freebsd-update install --not-running-from-cron




    Regards,
    vermaden


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Matthew D. Fuller@fullermd@over-yonder.net to muc.lists.freebsd.stable on Thu Jul 31 13:40:20 2025
    From Newsgroup: muc.lists.freebsd.stable

    On Thu, Jul 31, 2025 at 03:31:51PM +0200 I heard the voice of
    Ronald Klop, and lo! it spake thus:
    Van: "Patrick M. Hausen" <hausen@punkt.de>

    It's time to upgrade our ~100 hosts - again - and I would really
    like to at least partly automate the procedure.

    Current issue is that this sequence:

    freebsd-update upgrade -r 14.3 -b /tmp/be_mount.EkJx
    freebsd-update install -b /tmp/be_mount.EkJx
    freebsd-update install -b /tmp/be_mount.EkJx

    in my experience insists on asking "Does this look reasonable? (y/n)" interactively.

    Did you check freebsd-rustdate from ports/pkg? [...]

    As the author, I am clearly completely unbiased, so my agreement with
    such a suggestion is definitely a reliable argument-winner. Ahem.
    With that out of the way...

    freebsd-rustdate certainly _should_ do what you need, and I don't know
    any reason it wouldn't. It does work against all the same servers and
    data as freebsd-update. It uses the same config (at least the bits it supports). It also shares file storage (i.e., the stuff in /var/db/freebsd-update/files/), so one would see the files the other
    had downloaded. It doesn't share state, so one wouldn't see any
    pending updates to `install` from the other.


    A few notes for what seems to be your situation:

    - Non-interactivity was specifically a goal in the implementation.
    Obviously things like resolving conflicts need interaction, but
    that's part of why they're moved to a separate command; the basic
    fetch/upgrade/install commands don't take any interaction to run to
    completion.

    - The `install` command defaults to being very conservative; like
    freebsd-update, it installs one file at a time, and fsync()'s
    everything before moving on. That can take a while. If you're
    installing into something that's not the running system (like a new
    not-yet-active BE, or a subdir or jail or something), you can afford
    a little risk if the system crashes in the middle, so you could use

    - `install -s` to disable fsync(), which wastes way less time along
    the way,

    - `install -j` to use all those cores (and non-5400-rpm hard drive
    IOPS) that are just lying around, which can hide the fsync()
    delays as well, or

    - `install -sj` to get both.

    - (me, I tend to eat the risk even on live systems...)

    - Also, the `install` command has a `-a` argument to do all the
    potentially 3 steps (kernel, world, rm old libs) at once instead of
    taking multiple invocations.

    - Note that general arguments like `-b` are arguments to the base
    command, not the subcommand, so you'd be doing things like

    % freebsd-rustdate -b /tmp/bs_mount.EkJx upgrade -r 14.3-RELEASE


    The program has reasonable --help bits through the various commands.
    The webpage has longer docs for the commands, some stuff about
    differences from freebsd-update, and whatever other blathering I did
    at the time. And I'm certainly happy to give any help I can.
    --
    Matthew Fuller (MF4839) | fullermd@over-yonder.net
    Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
    On the Internet, nobody can hear you scream.


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Pete Wright@pete@nomadlogic.org to muc.lists.freebsd.stable on Thu Jul 31 11:49:52 2025
    From Newsgroup: muc.lists.freebsd.stable



    On 7/31/25 04:09, Patrick M. Hausen wrote:
    Hi all,

    It's time to upgrade our ~100 hosts - again - and I would really
    like to at least partly automate the procedure.

    Current issue is that this sequence:

    freebsd-update upgrade -r 14.3 -b /tmp/be_mount.EkJx
    freebsd-update install -b /tmp/be_mount.EkJx
    freebsd-update install -b /tmp/be_mount.EkJx

    in my experience insists on asking "Does this look reasonable? (y/n)" interactively.

    And no version of

    export ASSUME_ALWAYS_YES=yes

    or

    --not-running-from-cron

    seems to change that.

    Am I missing anything? I mean, after updating a handful of test
    systems - and especially when upgrading into a new BE -
    it should be possible to just rollout the new release via Ansible.


    i usually handle updating our fleet by just rebuilding the systems since
    i am on AWS and that's a more natural design pattern for them. there is
    this rc script included in the FreeBSD AMI's on AWS that automates
    applying patches via freebsd-update:

    firstboot_freebsd_update_run()
    {

    if ! checkyesno firstboot_freebsd_update_nonstandard; then
    case "`uname -r`" in
    *-BETA* | *-RC* | *-RELEASE*)
    ;;
    *)
    echo "Firstboot freebsd-update disabled on
    `uname -r`"
    return 0
    ;;
    esac
    fi

    env HTTP_TIMEOUT=5 freebsd-update --not-running-from-cron fetch
    if [ -e /var/db/freebsd-update/`echo / | sha256`-install ]; then
    freebsd-update install
    echo "Requesting reboot after installing updates."
    touch ${firstboot_sentinel}-reboot
    fi
    }


    this tends to work pretty well in an automated fashion. but to be
    honest i'm looking forward to pkgbase as it will make automation and
    auditing *much* easier in cloud environments.

    -pete


    Thanks and kind regards,
    Patrick
    --
    Pete Wright
    pete@nomadlogic.org



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2