From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0272E138334 for ; Wed, 27 Nov 2019 16:40:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 40EF2E08F3; Wed, 27 Nov 2019 16:40:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 29762E08F3 for ; Wed, 27 Nov 2019 16:40:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 89C5434D4D8 for ; Wed, 27 Nov 2019 16:40:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0B91D8C3 for ; Wed, 27 Nov 2019 16:40:17 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1574870748.80b8bc853f44dbd8e4042b4ac3c64a1f5d8f63af.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 80b8bc853f44dbd8e4042b4ac3c64a1f5d8f63af X-VCS-Branch: master Date: Wed, 27 Nov 2019 16:40:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 30f5482c-b2db-4e9f-8ae9-09819de2d821 X-Archives-Hash: 4fd660ae39719f33d9fe4ed68b90c04c commit: 80b8bc853f44dbd8e4042b4ac3c64a1f5d8f63af Author: Thomas Deutschmann gentoo org> AuthorDate: Wed Nov 27 10:43:41 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Wed Nov 27 16:05:48 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=80b8bc85 initrd.scripts: start_sshd(): Only set gk.prompt.timeout when dropbear was actually started If we failed to start dropbear for some reason, user has no chance to answer prompt without physical access so setting gk.prompt.timeout would only cause an unnecessary delay. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.scripts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 96ca339..dd5be3b 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -2250,12 +2250,6 @@ start_sshd() { return fi - if [ "${GK_PROMPT_TIMEOUT}" = '0' ] - then - warn_msg "Changing gk.prompt.timeout=0 to 30 to allow remote user to answer prompts ..." - GK_PROMPT_TIMEOUT=30 - fi - if [ ! -x "/usr/sbin/dropbear" ] then bad_msg "/usr/sbin/dropbear not found! Was initramfs built without --ssh parameter?" @@ -2275,6 +2269,14 @@ start_sshd() { good_msg "Starting dropbear sshd ..." ${QUIET} run /usr/sbin/dropbear -p ${GK_SSHD_PORT} -R -P "${GK_SSHD_PIDFILE}" 2>/var/log/dropbear.log + if [ $? -eq 0 ] + then + if [ "${GK_PROMPT_TIMEOUT}" = '0' ] + then + warn_msg "Changing gk.prompt.timeout=0 to 30 to allow remote user to answer prompts ..." + GK_PROMPT_TIMEOUT=30 + fi + fi } wait_sshd() {