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 AB17A138334 for ; Wed, 7 Aug 2019 15:46:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D36F0E08A0; Wed, 7 Aug 2019 15:46:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 BE53CE08A0 for ; Wed, 7 Aug 2019 15:46:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 D0BA63494AC for ; Wed, 7 Aug 2019 15:46:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 104BE75E for ; Wed, 7 Aug 2019 15:46:10 +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: <1565124032.d218502dd92b79e7920152d17843620d56d00756.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.defaults defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: d218502dd92b79e7920152d17843620d56d00756 X-VCS-Branch: master Date: Wed, 7 Aug 2019 15:46:10 +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: 9d9708c7-94d0-482c-a76b-fcfbde981211 X-Archives-Hash: 335347e9157d91ade4357d81076e163b commit: d218502dd92b79e7920152d17843620d56d00756 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Aug 6 15:34:53 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Aug 6 20:40:32 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d218502d initrd.scripts: run_shell(): Use LOCK file We cannot write PID because we use exec and don't return before the shell we just spawned was closed. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.defaults | 2 +- defaults/initrd.scripts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index 89d13ac..fdf948e 100644 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -81,7 +81,7 @@ GK_NET_TIMEOUT_DAD=10 GK_NET_TIMEOUT_DECONFIGURATION=10 GK_NET_TIMEOUT_DHCP=10 GK_NET_TIMEOUT_INTERFACE=10 -GK_SHELL_LOCKFILE='/var/run/rescueshell.pid' +GK_SHELL_LOCKFILE='/tmp/rescueshell.lock' GK_SSHD_LOCKFILE='/tmp/remote-rescueshell.lock' GK_SSHD_PIDFILE='/var/run/dropbear.pid' GK_SSHD_PORT=22 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 994f0f0..2452f5f 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -818,6 +818,8 @@ check_loop() { run_shell() { [ -x /bin/sh ] && SH=/bin/sh || SH=/bin/ash + touch "${GK_SHELL_LOCKFILE}" + export PS1='rescueshell \w \# ' echo @@ -838,9 +840,9 @@ run_shell() { ${SH} --login fi - echo + rm "${GK_SHELL_LOCKFILE}" - :> "${GK_SHELL_LOCKFILE}" + echo } fs_type_in_use() {