2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-20 17:32:15 +00:00
Files
xcat-core/xCAT-server/debian/prerm
T
Vinícius Ferrão 199e4733a7 feat(uftp): add the UFTP transfer listener
Booting nodes need a server that sends a published root image once to
every node that asks for it in a short window.

xcat-uftp-listener accepts HTTP/1.0 GET requests that name an image
path and its digest. It serves only an archive that packimage published
under the configured image roots, for a digest that the checksum file
lists. It keeps the archive open from the first request, so a later
packimage does not change the bytes of a queued batch. It collects the
requests for the same inode, digest and port for batch_delay seconds,
then runs one closed-group uftp session for the batch. Connections,
queued jobs, senders and receivers per job are limited.

The sender gets an argument vector built only from the configuration,
and signs the encrypted session with a persistent server key. It drops a
receiver that misses nearly every block of a section, so one node
without multicast cannot hold the session open. A sender that is not the
UFTP 5 build of xcat-dep is refused.

block_size allows larger packets on jumbo frame networks, up to the
8800-byte limit of uftp.

xCAT::UFTP holds the decisions of the listener: request checks, batches,
limits, timeouts and the runtime check. The script holds the sockets,
the key commands and the sender processes.

The packages install the service but do not enable it. Package removal
stops and disables it.
2026-10-21 11:44:21 -03:00

60 lines
1.7 KiB
Bash

#!/bin/sh
# prerm script for xCAT-server
#
# see: dh_installdeb(1)
set -e
xcatd_init_compat=/opt/xcat/share/xcat/scripts/xcatd-init-compat
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove)
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
if "$xcatd_init_compat" can-use-systemctl; then
systemctl stop xcatd.service
systemctl disable --now xcat-uftp-listener.service >/dev/null 2>&1 || true
elif ! "$xcatd_init_compat" uses-systemd --explicit-target && [ -x /etc/init.d/xcatd ]; then
/etc/init.d/xcatd stop
fi
fi
if "$xcatd_init_compat" uses-systemd --explicit-target; then
if command -v systemctl >/dev/null 2>&1; then
systemctl disable xcatd.service
fi
else
if command -v update-rc.d >/dev/null 2>&1; then
update-rc.d -f xcatd remove
fi
fi
;;
upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm 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