2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-29 15:51:18 +00:00

Altered statelite behavior w.r.t. /etc/mtab on RHEL7 distros

This commit is contained in:
frey
2016-06-16 16:00:15 -04:00
parent 5203da6cf2
commit 477bd80752

View File

@@ -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;
}