From 477bd807529af7271c6fdba7ff42736bb51623a2 Mon Sep 17 00:00:00 2001 From: frey Date: Thu, 16 Jun 2016 16:00:15 -0400 Subject: [PATCH] Altered statelite behavior w.r.t. /etc/mtab on RHEL7 distros --- xCAT-server/lib/xcat/plugins/statelite.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index d355d9bee..48b20eba3 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -797,6 +797,18 @@ sub liteItem { # the /etc/mtab should be handled every time even the parent /etc/ has been handled. # if adding /etc/ to litefile, only tmpfs should be used. if ($entry[1] eq "/etc/mtab") { + # + # In RHEL7 /etc/mtab is a symlink to /proc/self/mounts and not a regular file. + # If that's the case, then we skip forcing /etc/mtab into the .statelite path + # and symlink'ing /etc/mtab to that file. Otherwise, since the OS isn't updating + # /etc/mtab commands like "df" will not be happy. + # + my $ret=`readlink $rootimg_dir/etc/mtab`; + chomp($ret); + if ($? == 0 and ($ret eq '/proc/self/mounts') ) { + $verbose && $callback->({info=>["skipping /etc/mtab (symlink to /proc/self/mounts)"]}); + next; + } $isChild = 0; }