From patchwork Wed Mar 31 22:42:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Cekal X-Patchwork-Id: 4007 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4F9hDy1p70z3ws3 for ; Wed, 31 Mar 2021 22:43:46 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4F9hDx1XKLznY; Wed, 31 Mar 2021 22:43:45 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4F9hDx0JDkz2xlC; Wed, 31 Mar 2021 22:43:45 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4F9hDv69WKz2xPJ for ; Wed, 31 Mar 2021 22:43:43 +0000 (UTC) Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe05-1.mx.upcmail.net [84.116.36.11]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4F9hDt4RCDzC6 for ; Wed, 31 Mar 2021 22:43:42 +0000 (UTC) Received: from [172.31.216.234] (helo=vie01a-pemc-psmtp-pe11.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lRjYs-0005Tu-0C for development@lists.ipfire.org; Thu, 01 Apr 2021 00:43:42 +0200 Received: from mail.cekal.org ([80.108.243.10]) by vie01a-pemc-psmtp-pe11.mail.upcmail.net with ESMTP id RjXtlPPQpA9ImRjXtlpLbX; Thu, 01 Apr 2021 00:42:41 +0200 X-Env-Mailfrom: admin@cekal.org X-Env-Rcptto: development@lists.ipfire.org X-SourceIP: 80.108.243.10 X-CNFS-Analysis: v=2.3 cv=HtQI5HbS c=1 sm=1 tr=0 a=ITTpLutqCFT44XJQkAlHYA==:117 a=ITTpLutqCFT44XJQkAlHYA==:17 a=3YhXtTcJ-WEA:10 a=Bhkv7vxiAAAA:8 a=FYzRmpreAAAA:8 a=FWZdZUIF5phy-CDPNQUA:9 a=qiWi7Edwir4A:10 a=OmuBX-08IoMA:10 a=NWVoK91CQyQA:10 a=mZv8WrvrGYPQWQ00YoKY:22 a=BlBMh0SLvpUPX6oqyl_u:22 a=pHzHmUro8NiASowvMSCR:22 a=n87TN5wuljxrRezIQYnT:22 Received: from mail.cekal.org (localhost [127.0.0.1]) by mail.cekal.org (Postfix) with ESMTP id A28E910ACEC1; Thu, 1 Apr 2021 00:42:41 +0200 (CEST) Received: from localhost.localdomain (80-109-193-73.cable.dynamic.surfer.at [80.109.193.73]) (Authenticated sender: admin@cekal.org) by mail.cekal.org (Postfix) with ESMTPSA id 7E43F10ACEC0; Thu, 1 Apr 2021 00:42:41 +0200 (CEST) From: Thomas Cekal To: development@lists.ipfire.org Subject: [PATCH] BUG12445: Fix for Hyper-V stuck 8 minutes at boot Date: Thu, 1 Apr 2021 00:42:35 +0200 Message-Id: <20210331224236.12971-1-admin@cekal.org> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CMAE-Envelope: MS4wfG1c76vK2l2xMY3nR89C9AB835S4TQT8tI28GN5ns4Sj4RA0g7UjY8AzFYmYOlU1AQvhfEYFoBluMSUAh26JfVzh4gf/scTqOUSh11G+4kVYq+jhgD5n 5tuy0z+v2bP6LGLwf8arbTXoqBk9UjzcV0Kq0VCisMcQCwIJvygicGF1nq9YHpoYhajNlIiot+ITsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1617230622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=ugIysoNbkm4Q+FBHas3pGPk29Nrp6z2t388XXAUjXsc=; b=HuoWEWWCwvBtvCgt+R2m7Xe2u/tuBys2TpkzzJmamgoh1qf7i8UeRwNi9GqByaM+dYIMiU xOZh+cPNsJVPx80fXehfWwvKC7lqUdjGMulE2cXDy4UZpBCn4AKFoyDgiWUVnF5xHIH7zq wITwKWGNMi0JeL8Dr+a0V0siSfE0RvABA41KujbSPa3tgfeY6MouD4KOuloc2V0g127YVr qMiEBBLiY8DcEid9QI6gg4rLRx14TGlS7bF6V0MozU7OdSZlYfXZ9Z09oNOOc2wdSF6m6B 3TGBOyNLXrK6l7I+qeCYxBywTpdwaXPCTCoP/Qqqb1gVwBv0r4VhRMQU4y5Z7g== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=none (mail01.ipfire.org: domain of admin@cekal.org has no SPF policy when checking 84.116.36.11) smtp.mailfrom=admin@cekal.org ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1617230622; a=rsa-sha256; cv=none; b=rN1j5iYZtuQtP+qgTURGU0KqKrY0GcFXFtto6iUDA9cgPjbK2JIv1LKH0+YRBoQwPCmj+R a7HvasdtESlrrZ5P8agU8i0bqI0oM2ku75KwxUmW2uabXCHs/BePEol+XEKJAddNZ9DC8b T6gQf40yIoYKp7ROwKUS85sFsX9kFKIplE1Vc9u/eVP5zxjsDOhOJNx4/XENv1KK2cbk2j AFZTnKJyM3B7Cm+QEANvWL57S6WtNzCjg40w1GfBtj06zfo0MqZwRl2Sq1AQyW//+ygONk ZkgPbedTyl+0Kt1aF/ADLYZOhZHSHEzu9tClgJ6jdLuijQVyVKBfd53q8sKxow== X-Rspamd-Queue-Id: 4F9hDt4RCDzC6 Authentication-Results: mail01.ipfire.org; dkim=none; spf=none (mail01.ipfire.org: domain of admin@cekal.org has no SPF policy when checking 84.116.36.11) smtp.mailfrom=admin@cekal.org; dmarc=none X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-1.21 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[80.109.193.73:received,80.108.243.10:received]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; IP_REPUTATION_HAM(-0.01)[asn: 6830(0.00), country: NL(-0.01), ip: 84.116.36.11(0.00)]; MIME_GOOD(-0.10)[text/plain]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; DMARC_NA(0.00)[cekal.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6830, ipnet:84.116.0.0/16, country:NL]; RCVD_TLS_LAST(0.00)[]; BAYES_HAM(-3.00)[99.99%]; RCVD_IN_DNSWL_LOW(-0.10)[84.116.36.11:from] X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Fix for Bug 12445: There is no proper way to distinguish between MS Azure and a local Hyper-V installation Procedure: try to get the metadata info from the internal MS metadata service at IP 169.254.169.254 If this fails the system is running on an local Hyper-V instance wget takes too long to exit if the IP is not reachable Added --timeout and --tries param to wget to reduce the duation from 8 minutes to 10 seconds 10 seconds at one try should be enough Signed-off-by: Thomas Cekal --- src/initscripts/helper/azure-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/initscripts/helper/azure-setup b/src/initscripts/helper/azure-setup index 5157712fc..a0d547588 100644 --- a/src/initscripts/helper/azure-setup +++ b/src/initscripts/helper/azure-setup @@ -9,7 +9,7 @@ export PATH=/usr/local/sbin:/usr/local/bin:${PATH} get() { local file="${1}" - wget -qO - --header="Metadata:true" "http://169.254.169.254/metadata/instance/${file}?api-version=2019-06-01&format=text" + wget --timeout=10 --tries=1 -qO - --header="Metadata:true" "http://169.254.169.254/metadata/instance/${file}?api-version=2019-06-01&format=text" } format_mac() {