On Sat, 09 Jul 2016 18:25:08 +0200, Frank Scheiner wrote:
> Running the command substitution alone after the machine has finished
> booting - which takes a considerable extra amount of time as the
> SPARCclassic is a slow machine and its root FS is mounted via NFS -
> gives the following in my case:
>
> ```
> # stat -L -f '%Sd' /usr/lib
> ??
> # echo $?
> 0
> ```
That makes sense. What stat(1) actually does is call stat(2) on
/usr/lib and look up the resulting device number using devname(3).
Since it can't be found it returns "??" which is useful for ps but
not much else.
We can simplify the check and simply treat a value of "??" as
non-local and skip the reorder.
- todd
Index: rc
===================================================================
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.485
diff -u -p -u -r1.485 rc
--- rc 29 May 2016 15:36:06 -0000 1.485
+++ rc 10 Jul 2016 01:35:46 -0000
@@ -164,8 +164,8 @@ reorder_libs() {
local _dkdev=/dev/$(stat -L -f '%Sd' /usr/lib)
local _mp=$(mount | grep "^$_dkdev")
- # Skip if /usr/lib is on a nfs mounted filesystem.
- [[ $_mp == *' type nfs '* ]] && return
+ # Skip if /usr/lib is not on a local filesystem.
+ [ $_dkdev == '??' ] && return
echo -n 'reordering libraries:'