[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#750360: systemd-sysv: breaks NFS root systems



On 2014-06-03 21:30 +0200, maximilian attems wrote:

> On Tue, Jun 03, 2014 at 08:03:16PM +0200, Sven Joachim wrote:
>> 
>> Is this test going to work for systems with a separate /usr ?
>> 
>> ,----
>> | $ which test
>> | /usr/bin/test
>> `----
>> 
>
> dash or bash or POSIX shells have builtin test too.
> so yes it should just work.

The code which which you committed does not seem to invoke /bin/sh, and
you can't run shell builtins that way:

,----
| # LC_ALL=C chroot /var/cache/pbuilder/build/4383/ cd /tmp
| chroot: failed to run command 'cd': No such file or directory
`----

I guess the following should work (untested):

--8<---------------cut here---------------start------------->8---
diff --git a/scripts/nfs b/scripts/nfs
index 967e67f..3b7ade2 100644
--- a/scripts/nfs
+++ b/scripts/nfs
@@ -67,7 +67,7 @@ mountroot()
 	# loop until nfsmount succeeds
 	do_nfsmount
 	while [ ${retry_nr} -lt ${delay} ] \
-		&& ! chroot "${rootmnt}" test -x "${init}" ; do
+		&& ! chroot "${rootmnt}" /bin/sh -c "test -x ${init}" ; do
 		[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
 		/bin/sleep 1
 		do_nfsmount
--8<---------------cut here---------------end--------------->8---

Cheers,
       Sven


Reply to: