Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jan 2024 18:11:11 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 9f5c2e34f226 - stable/13 - renice: Force /bin/sh usage on su calls for the regression tests.
Message-ID:  <202401211811.40LIBBGW052040@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=9f5c2e34f226a7ffd04a71dfb5e9c7f358068607

commit 9f5c2e34f226a7ffd04a71dfb5e9c7f358068607
Author:     Olivier Cochard <olivier@FreeBSD.org>
AuthorDate: 2022-10-13 15:23:54 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-01-21 16:11:08 +0000

    renice: Force /bin/sh usage on su calls for the regression tests.
    
    If the root account is configured to use a different shell than sh,
    it fails to retreive the pid of the background process.
    
    Approved by:    des
    Obtained from:  chs
    Sponsored by:   Netflix
    Differential Revision:  https://reviews.freebsd.org/D36930
    
    (cherry picked from commit 07b1ea961af77d728dfef4d0a11f98a8ab2fe226)
---
 usr.bin/renice/tests/renice_test.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/renice/tests/renice_test.sh b/usr.bin/renice/tests/renice_test.sh
index feb07a6af825..8a4df7879ad4 100755
--- a/usr.bin/renice/tests/renice_test.sh
+++ b/usr.bin/renice/tests/renice_test.sh
@@ -90,7 +90,7 @@ renice_abs_user_head() {
 }
 renice_abs_user_body() {
 	local user pid nice incr
-	pid=$(su -m $TEST_USER -c "sleep 60 >/dev/null & echo \$!")
+	pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")
 	nice="$(ps -o nice= -p $pid)"
 	incr=3
 	_renice $((nice+incr)) -u $TEST_USER
@@ -105,7 +105,7 @@ renice_rel_user_head() {
 }
 renice_rel_user_body() {
 	local user pid nice incr
-	pid=$(su -m $TEST_USER -c "sleep 60 >/dev/null & echo \$!")
+	pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")
 	nice="$(ps -o nice= -p $pid)"
 	incr=3
 	_renice -u -n $incr $TEST_USER



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401211811.40LIBBGW052040>