apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.02k stars 339 forks source link

t3c: Can't detect SystemD in Rocky Linux 9 #7858

Open smalenfant opened 8 months ago

smalenfant commented 8 months ago

This Bug Report affects these Traffic Control components:

What did you do?

Installed Cache Config on Rocky LInux 9 and it won't detect systemd as the service management.

What did you expect to happen?

Cache config to enable traffic server service

What actually happened?

After rebooting the server after the initial install, cache config did not enable Traffic Server.

I could see the following in the log: OS checks are enabled and unable to find any know service management tools.

Notes

The command used by t3c is the following and it works just fine when used manually.

# /bin/sh -c "/bin/systemctl --version"
systemd 252 (252-14.el9_2.3.0.1)
+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified
smalenfant commented 8 months ago

I believe I found the problem.

RHEL9 doesn't come with /sbin/chkconfig. But the code is not handling this right. Will always be Unknown.

https://github.com/apache/trafficcontrol/blob/2eb00e0cfd8e83ee77ea6016ceaaa272538d55a3/cache-config/t3c-apply/config/config.go#L677-L691

I'm not sure why this is not a different conditional.