Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 0a3f5c0c7e15f0da905ba888492a351e > scriptlet

hadoop-hdfs-2.7.7-4.mga7.noarch.rpm

PRETRANS

<lua>
path = "/usr/share/hadoop/hdfs/webapps"
st = posix.stat(path)
if st and st.type == "link" then
  os.remove(path)
end

PREIN

/bin/sh
getent group hdfs >/dev/null || groupadd -r hdfs
getent passwd hdfs >/dev/null || /usr/sbin/useradd --comment "Apache Hadoop HDFS" --shell /sbin/nologin -M -r -g hdfs -G hadoop --home /var/lib/hadoop-hdfs hdfs

PREUN

/bin/sh
/usr/share/rpm-helper/del-service hadoop $1 hadoop-zkfc.service hadoop-datanode.service hadoop-secondarynamenode.service hadoop-namenode.service hadoop-journalnode.service

POSTIN

/bin/sh
# Change the home directory for the hdfs user
if [[ `getent passwd hdfs | cut -d: -f 6` != "/var/lib/hadoop-hdfs" ]]
then
  /usr/sbin/usermod -d /var/lib/hadoop-hdfs hdfs
fi

if [ $1 -gt 1 ]
then
  if [ -d /var/cache/hadoop-hdfs ] && [ ! -L /var/cache/hadoop-hdfs ]
  then
    # Move the existing hdfs data to the new location
    mv -f /var/cache/hadoop-hdfs/* /var/lib/hadoop-hdfs/
  fi
fi
/usr/share/rpm-helper/add-service hadoop $1 hadoop-zkfc.service hadoop-datanode.service hadoop-secondarynamenode.service hadoop-namenode.service hadoop-journalnode.service 

/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/hadoop-hdfs.conf

POSTUN

/bin/sh
/usr/share/rpm-helper/reread-services hadoop 


if [ $1 -lt 1 ]
then
  # Remove the compatibility symlink
  rm -f /var/cache/hadoop-hdfs
fi

POSTTRANS

/bin/sh
# Create a symlink to the new location for hdfs data in case the user changed
# the configuration file and the new one isn't in place to point to the
# correct location
if [ ! -e /var/cache/hadoop-hdfs ]
then
  ln -s /var/lib/hadoop-hdfs /var/cache
fi