From: Daniel Gomez <da.gomez@kernel.org>
To: kdevops@lists.linux.dev, Luis Chamberlain <mcgrof@kernel.org>,
Daniel Gomez <da.gomez@samsung.com>
Cc: Daniel Gomez <da.gomez@kernel.org>
Subject: [PATCH v2 3/4] guestfs: bringup: fix user check when debug
Date: Mon, 12 May 2025 15:36:04 +0200 [thread overview]
Message-ID: <20250512-bringup-guestfs-debug-v2-3-bd5691108448@samsung.com> (raw)
In-Reply-To: <20250512-bringup-guestfs-debug-v2-0-bd5691108448@samsung.com>
From: Daniel Gomez <da.gomez@samsung.com>
Replace id -u with getent to check if the user exists.
Avoids id: 'kdevops': no such user.
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
scripts/bringup_guestfs.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh
index 3681423eff2849bc63519641ad09d974d421589a..3fd48331b73f51e23818c553f8973d17d38dffca 100755
--- a/scripts/bringup_guestfs.sh
+++ b/scripts/bringup_guestfs.sh
@@ -189,8 +189,7 @@ _EOT
pre_install_customizations()
{
KDEVOPS_UID=""
- id -u kdevops > /dev/null 2>&1
- if [ $? -eq 0 ]; then
+ if getent passwd kdevops > /dev/null 2>&1; then
KDEVOPS_UID="-u `id -u kdevops`"
fi
if echo $OS_VERSION | grep -qE "^(rhel|fedora|centos)"; then
--
2.49.0
next prev parent reply other threads:[~2025-05-12 13:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 13:36 [PATCH v2 0/4] guestfs: bringup: add debug mode Daniel Gomez
2025-05-12 13:36 ` [PATCH v2 1/4] guestfs: bringup: check if domain exists Daniel Gomez
2025-05-12 13:36 ` [PATCH v2 2/4] guestfs: bringup: fix unbound variable when debug Daniel Gomez
2025-05-12 13:36 ` Daniel Gomez [this message]
2025-05-12 13:36 ` [PATCH v2 4/4] guestfs: bringup: add debug mode Daniel Gomez
2025-05-12 15:43 ` [PATCH v2 0/4] " Chuck Lever
2025-05-13 5:49 ` Daniel Gomez
2025-05-14 18:28 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250512-bringup-guestfs-debug-v2-3-bd5691108448@samsung.com \
--to=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox