xcatd.service sets XCATROOT and PATH to the literal /opt/xcat. The
previous ExecStart sourced xcat.sh, which %post generates from
RPM_INSTALL_PREFIX0, so a relocated package got its own prefix. With the
package installed under /srv/xcat the daemon symlink reaches
/srv/xcat/sbin/xcatd and the Perl search path still names /opt/xcat, so
xcatd cannot load its own modules unless the administrator overrides the
environment or a default installation is left behind.
%post writes /etc/xcat/xcatroot.env with XCATROOT and PATH built from
RPM_INSTALL_PREFIX0, and the unit reads it with EnvironmentFile. The
order is the default in the unit, then that file, then
/etc/sysconfig/xcat, so the recorded prefix replaces the default and the
site file keeps the last word. ExecStart stays a direct call, so the
kernel still enters xcat_t on the xcatd script. %preun removes the file
on erase. The file is not in %files, so rpm --verify is unaffected.
xcatd_relocated_startup.t fails 3 checks of its /srv/xcat subtest
without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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.
The unit file and xcatd_service_direct_exec.t said that a direct ExecStart
keeps xcatd out of initrc_t and in unconfined_service_t. The entrypoint of
the xcat_t domain is the xcatd script, so a shell in ExecStart now costs the
domain, not the confinement.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcatd.service started xcatd through /bin/sh to read
/etc/profile.d/xcat.sh. systemd runs the shell in initrc_t, and xcatd
inherited that domain. initrc_t moves rsync, useradd, groupadd, hwclock
and setfiles into confined domains, so an enforcing management node
denies syncfiles, updatenode -F and genimage.
ExecStart now runs /usr/sbin/xcatd directly. systemd starts the bin_t
binary in unconfined_service_t, which has none of these transitions. The
unit sets XCATROOT, PATH and PERL_BADLANG with Environment=, and
/etc/sysconfig/xcat can still override them. RPM and Debian packages ship
the same unit. The SysV script for hosts without systemd still reads the
profile.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Add buildrpms.pl to build RPMs in parallel using mock
Add xCAT-buildkit to the build list
Fix build dependency in xCAT-buildkit.spec
Add fallback in /etc/init.d/xcatd for /etc/rc.d/init.d/functions
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
Previously service xcatd stop or systemctl stop xcatd.service
will send TERM signal to all the processes of xcatd on some
platform which support this feature.
Close-issue: #1008#537
xCAT in some cases was reporting improper status for certain scenarios.
Risk being inaccure if no pid file exists so that it is accurate when it
does exist.