From owner-freebsd-bugs@freebsd.org Tue Feb 5 18:52:15 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCAE14C57A9 for ; Tue, 5 Feb 2019 18:52:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 82F5B8A985 for ; Tue, 5 Feb 2019 18:52:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 465C314C57A4; Tue, 5 Feb 2019 18:52:14 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21A6914C57A3 for ; Tue, 5 Feb 2019 18:52:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF52D8A97D for ; Tue, 5 Feb 2019 18:52:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id B54B512B30 for ; Tue, 5 Feb 2019 18:52:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x15IqCQ3058193 for ; Tue, 5 Feb 2019 18:52:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x15IqCqU058192 for bugs@FreeBSD.org; Tue, 5 Feb 2019 18:52:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 235538] [patch] freebsd-update: Try to avoid failing when network is unavailable Date: Tue, 05 Feb 2019 18:52:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rfraile@rfraile.eu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2019 18:52:15 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235538 Bug ID: 235538 Summary: [patch] freebsd-update: Try to avoid failing when network is unavailable Product: Base System Version: 12.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: rfraile@rfraile.eu Created attachment 201777 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D201777&action= =3Dedit Add fetch_check_connection function to freebsd-update Hello, Running freebsd-update in a system with limited resources (low power cpu an= d sd storage as disk for example) takes a long time (+5 hours in a RaspberryPi).= If we also have a poor network link dependent to a mobile 3G network, is more difficult to complete it properly. When freebsd-update execute the lines that calls phttpget, if the network is unavailable, it directly fails, throwing away the time spend previously. There is a workaround tunning phttpget with the HTTP_TIMEOUT environment variable, but it only works before doing the tcp connection. If it can't resolve the dns, it fails ending the execution. The solution that I include in the patch adds a call to the server previous= the phttpget execution, checking if it was ok or not, looping on it waiting 60 seconds until the next try if it fails. If the executions is made from cron= , it only loops once and fails. If you are looking over the upgrade and see that is stuck on that point, you have a chance to fix it, restart the modem, wait until you receive better connectivity or whatever, but it can continue. In the new function I use the fetch command because is used already on freebsd-update and its part of the base system. Also netcat or telnet can be used, but the environmental variables that can modify the fetch behaviour, = like http_proxy, aren't available on those alternatives. As well, I use for fetch the file latest.ssl because the other file that I found, pub.ssl, is a bit larger. I didn't find any other way to get a dumb = file like a readme.txt or similar in the updateN.freebsd.org servers. I tested it and works as expected. Thanks, --=20 You are receiving this mail because: You are the assignee for the bug.=