2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-06 00:59:13 +00:00
Files
xcat-core/xCAT-server/debian/postinst
2026-05-04 18:13:23 -03:00

70 lines
2.1 KiB
Bash

#!/bin/sh
# postinst script for openmpi
#
# see: dh_installdeb(1)
set -e
xcat_can_use_systemctl()
{
[ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1
}
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
. /etc/profile.d/xcat.sh
if [ -f /tmp/xCAT-server_upgrade.tmp ]; then
if xcat_can_use_systemctl; then
if [ -f /run/systemd/generator.late/xcatd.service ]; then
# To cover the case upgrade from no xcatd systemd unit file (cannot enable by default for HA case)
if ls /etc/rc?.d/S??xcatd >/dev/null 2>&1; then
[ -x /usr/sbin/update-rc.d ] && /usr/sbin/update-rc.d xcatd remove
systemctl daemon-reload
systemctl enable xcatd.service
fi
else
systemctl daemon-reload
fi
fi
# No need to reload xcatd here as it will be covered by xCAT/xCATsn now
rm /tmp/xCAT-server_upgrade.tmp
else
if xcat_can_use_systemctl; then
systemctl daemon-reload
systemctl enable xcatd.service
elif command -v update-rc.d >/dev/null 2>&1; then
update-rc.d xcatd defaults
fi
fi
ln -sf /opt/xcat/sbin/xcatd /usr/sbin/xcatd
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0