From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 26 Apr 2021 11:03:16 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lax9A-0002vp-Ej for lore@lore.pengutronix.de; Mon, 26 Apr 2021 11:03:16 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lax99-0001HU-Ri; Mon, 26 Apr 2021 11:03:15 +0200 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lax96-0001HI-EK; Mon, 26 Apr 2021 11:03:12 +0200 Received: from rsc by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1lax96-0004HO-3Z; Mon, 26 Apr 2021 11:03:12 +0200 Date: Mon, 26 Apr 2021 11:03:12 +0200 From: Robert Schwebel To: Roland Hieber Message-ID: <20210426090312.ma4wpwcaszzlnvmi@pengutronix.de> References: <20210426083039.emm3pevfbwslmtt4@pengutronix.de> <20210426083555.10908-1-rhi@pengutronix.de> <20210426090216.fxkcrcubnptadyyg@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210426090216.fxkcrcubnptadyyg@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 11:02:30 up 144 days, 23:08, 48 users, load average: 0,08, 0,11, 0,09 User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [DistroKit] [PATCH v2] v7a: run: randomise the SSH forwarding port X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: distrokit@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Mon, Apr 26, 2021 at 11:02:16AM +0200, Robert Schwebel wrote: > On Mon, Apr 26, 2021 at 10:35:56AM +0200, Roland Hieber wrote: > > When multiple ./configs/platform-v7a/run scripts are run at the same > > time, the first qemu process will open port 4445, and following runs > > will fail. To prevent that, first look at the environment variable > > QEMU_SSH_PORT to determine the port to be used (so that users can set > > this in their shell to keep the port static), or fall back to a port > > between 1025 and 65025 using the shell's PID as a seed, which should > > have a good chance of being unused. Also print the port forwarding > > before starting qemu, so we don't have to bother with "ps -Af|grep > > qemu". > > > > Signed-off-by: Roland Hieber > > > > --- > > v2: > > * use PPID instead of RANDOM to make the port reproducable in the same > > shell session (Michael Olbrich) > > --- > > configs/platform-v7a/run | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Could you rebase the patch against next? The subject could need some care as well, as it isn't "randomize" any more with the PPID change. rsc -- Pengutronix e.K. | Dipl.-Ing. Robert Schwebel | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | _______________________________________________ DistroKit mailing list DistroKit@pengutronix.de