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 38D64138350 for ; Tue, 14 Apr 2020 18:34:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 185ADE0942; Tue, 14 Apr 2020 18:34:55 +0000 (UTC) Received: from smtp.gentoo.org (dev.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 EA6A2E093E for ; Tue, 14 Apr 2020 18:34:54 +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 AC02434F320 for ; Tue, 14 Apr 2020 18:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 201DC1DC for ; Tue, 14 Apr 2020 18:34:52 +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: <1586889260.1bb133b505d5aade0cc0b6c6e16f1bc3e9a266f7.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/lvm2/files/lvm.rc-2.02.187 X-VCS-Directories: sys-fs/lvm2/files/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 1bb133b505d5aade0cc0b6c6e16f1bc3e9a266f7 X-VCS-Branch: master Date: Tue, 14 Apr 2020 18:34:52 +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: dcc030b2-aa64-438c-bbcd-10490c0c24c6 X-Archives-Hash: 81cd3d140247b7edc725d59dc8f8e38d commit: 1bb133b505d5aade0cc0b6c6e16f1bc3e9a266f7 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Apr 14 17:42:51 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Apr 14 18:34:20 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bb133b5 sys-fs/lvm2: runscript: rework start() - Don't use LVM script anymore: If one command within script failed, any following command won't run anymore. - Be verbose when rc_verbose=yes is set. - Only call pvscan when lvmetad is used. Signed-off-by: Thomas Deutschmann gentoo.org> sys-fs/lvm2/files/lvm.rc-2.02.187 | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.187 b/sys-fs/lvm2/files/lvm.rc-2.02.187 index d9c11730cdb..f9ad753ea82 100644 --- a/sys-fs/lvm2/files/lvm.rc-2.02.187 +++ b/sys-fs/lvm2/files/lvm.rc-2.02.187 @@ -86,24 +86,33 @@ start() { fi if [ -d /proc/lvm ] || dm_in_proc ; then - ebegin "Setting up the Logical Volume Manager" - #still echo stderr for debugging - lvm_commands="#!${lvm_path}\n" - # Extra PV find pass because some devices might not have been available until very recently - lvm_commands="${lvm_commands}pvscan --config '${config}'\n" + local has_errors=0 verbose_command + + yesno "${rc_verbose}" && verbose_command=" -v" + + ebegin "Starting the Logical Volume Manager" + + if _use_lvmetad ; then + # Extra PV find pass because some devices might not have been available until very recently + ${lvm_path} pvscan${verbose_command} --config "${config}" --cache + [ $? -ne 0 ] && has_errors=1 + fi + # Now make the nodes - lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n" - # And turn them on! - lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n" + ${lvm_path} vgscan${verbose_command} --config "${config}" --mknodes + [ $? -ne 0 ] && has_errors=1 + + # Enable all VGs + ${lvm_path} vgchange${verbose_command} --config "${config}" --sysinit --activate y + [ $? -ne 0 ] && has_errors=1 if _use_lvmlockd ; then # Start lockd VGs as required - lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n" + ${lvm_path} vgchange${verbose_command} --config "${config}" --lock-start --lock-opt auto + [ $? -ne 0 ] && has_errors=1 fi - # Order of this is important, have to work around dash and LVM readline - printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null - eend $? "Failed to setup the LVM" + eend ${has_errors} "Failed to start the Logical Volume Manager" fi fi }