From 06d2e6f6cd40148aff3b43b30e08ce10faa5c436 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Sun, 4 Jun 2023 21:50:49 +0000 Subject: [PATCH] Send a fail status if chcon fails Signed-off-by: Gabriel Adrian Samfira --- cloudconfig/templates.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudconfig/templates.go b/cloudconfig/templates.go index f62aa7ee..e088d2cd 100644 --- a/cloudconfig/templates.go +++ b/cloudconfig/templates.go @@ -130,8 +130,8 @@ sendStatus "installing runner service" ./svc.sh install {{ .RunnerUsername }} || fail "failed to install service" if [ -e "/sys/fs/selinux" ];then - sudo chcon -h user_u:object_r:bin_t /home/runner/ - sudo chcon -R -h {{ .RunnerUsername }}:object_r:bin_t /home/runner/* + sudo chcon -h user_u:object_r:bin_t /home/runner/ || fail "failed to change selinux context" + sudo chcon -R -h {{ .RunnerUsername }}:object_r:bin_t /home/runner/* || fail "failed to change selinux context" fi sendStatus "starting service"