From 112e1339b7a40bbad3db5167284f45191eb75c7a Mon Sep 17 00:00:00 2001 From: Hussein Galal Date: Tue, 31 Oct 2023 22:54:09 +0200 Subject: [PATCH] Restore selinux context systemd unit file (#8593) * Restore context of systemd unit file Signed-off-by: galal-hussein * Restore context of systemd unit file Signed-off-by: galal-hussein * update the hash of install.sh file Signed-off-by: galal-hussein --------- Signed-off-by: galal-hussein --- install.sh | 7 ++++++- install.sh.sha256sum | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7ef592dc79..8c5fd97023 100644 --- a/install.sh +++ b/install.sh @@ -961,11 +961,16 @@ EOF # --- write systemd or openrc service file --- create_service_file() { - [ "${HAS_SYSTEMD}" = true ] && create_systemd_service_file + [ "${HAS_SYSTEMD}" = true ] && create_systemd_service_file && restore_systemd_service_file_context [ "${HAS_OPENRC}" = true ] && create_openrc_service_file return 0 } +restore_systemd_service_file_context() { + restorecon -R -i ${FILE_K3S_SERVICE} || true + restorecon -R -i ${FILE_K3S_ENV} || true +} + # --- get hashes of the current k3s bin and service files get_installed_hashes() { $SUDO sha256sum ${BIN_DIR}/k3s ${FILE_K3S_SERVICE} ${FILE_K3S_ENV} 2>&1 || true diff --git a/install.sh.sha256sum b/install.sh.sha256sum index 6d5c29c3ca..d1e105edc1 100644 --- a/install.sh.sha256sum +++ b/install.sh.sha256sum @@ -1 +1 @@ -3798b669b3ede25b2d3bfb9039a744604efb3681a351b2c1e0b01b7b05f0a434 install.sh +ff8b7b4028299c878180c1288efa73205c54c7c3fbc2d313fcc666374526d221 install.sh