PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable zfs-fuse.service > /dev/null 2>&1 || :
/bin/systemctl stop zfs-fuse.service > /dev/null 2>&1 || :
fi
POSTIN
/bin/sh
# Move cache if upgrading
oldcache=/etc/zfs/zpool.cache # this changed per 0.6.9, only needed when upgrading from earlier versions
newcache=/var/lib/zfs/zpool.cache
if [[ -f $oldcache && ! -e $newcache ]]; then
echo "Moving existing zpool.cache to new location"
mkdir -p $(dirname $newcache)
mv $oldcache $newcache
else
if [ -e $oldcache ]; then
echo "Note: old zpool.cache present but no longer used ($oldcache)"
fi
fi
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
POSTUN
/bin/sh
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart zfs-fuse.service >/dev/null 2>&1 || :
echo "Removing files since we removed the last package"
rm -rf /var/run/zfs
rm -rf /var/lock/zfs
fi
Triggers
zfs-fuse <
0.7.0-4
/bin/sh
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply zfs-fuse
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save zfs-fuse >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del zfs-fuse >/dev/null 2>&1 || :
/bin/systemctl try-restart zfs-fuse.service >/dev/null 2>&1 || :