PREUN
/bin/sh
if [ $1 -eq 0 ]; then
if [ -f /usr/lib/systemd/system/glusterfsd.service ]; then
/bin/systemctl stop glusterfsd.service ; fi
/bin/systemctl stop glusterd.service ; if [ -f /usr/lib/systemd/system/glusterfsd.service ]; then
/bin/systemctl disable glusterfsd.service ; fi
/bin/systemctl disable glusterd.service ;fi
if [ $1 -ge 1 ]; then
if [ -f /usr/lib/systemd/system/glusterfsd.service ]; then
/bin/systemctl try-restart glusterfsd.service ; fi
/bin/systemctl try-restart glusterd.service ;fi
POSTIN
/bin/sh
# Legacy server
/bin/systemctl enable glusterd.service ;/bin/systemctl enable glusterfsd.service ;
# Genuine Fedora (and EPEL) builds never put gluster files in /etc; if
# there are any files in /etc from a prior gluster.org install, move them
# to /var/lib. (N.B. Starting with 3.3.0 all gluster files are in /var/lib
# in gluster.org RPMs.) Be careful to copy them on the off chance that
# /etc and /var/lib are on separate file systems
if [ -d /etc/glusterd -a ! -h /var/lib/glusterd ]; then
/usr/bin/mkdir -p /var/lib/glusterd
cp -a /etc/glusterd /var/lib/glusterd
rm -rf /etc/glusterd
ln -sf /var/lib/glusterd /etc/glusterd
fi
# Rename old volfiles in an RPM-standard way. These aren't actually
# considered package config files, so %config doesn't work for them.
if [ -d /var/lib/glusterd/vols ]; then
for file in $(find /var/lib/glusterd/vols -name '*.vol'); do
newfile=${file}.rpmsave
echo "warning: ${file} saved as ${newfile}"
cp ${file} ${newfile}
done
fi
# add marker translator
# but first make certain that there are no old libs around to bite us
# BZ 834847
if [ -e /etc/ld.so.conf.d/glusterfs.conf ]; then
rm -f /etc/ld.so.conf.d/glusterfs.conf
/sbin/ldconfig
fi
pidof -c -o %PPID -x glusterd &> /dev/null
if [ $? -eq 0 ]; then
kill -9 `pgrep -f gsyncd.py` &> /dev/null
killall glusterd &> /dev/null
glusterd --xlator-option *.upgrade=on -N
else
glusterd --xlator-option *.upgrade=on -N
fi