From 99bee37cce4346dd90491ba56fcbce8670ae3e10 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 23 Jan 2024 16:03:14 +0100 Subject: [PATCH] Removing user and group 'cloud-user' on postinstall actions --- postinstall-scripts/update-all-packages | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/postinstall-scripts/update-all-packages b/postinstall-scripts/update-all-packages index c5444be..1360617 100755 --- a/postinstall-scripts/update-all-packages +++ b/postinstall-scripts/update-all-packages @@ -198,6 +198,7 @@ ok==1 {print "ip_resolve=4"; ok=0} if rpm -qa | grep --quiet --perl-regexp '^cloud-init-\d' ; then exec_cmd ${tool} --assumeyes erase cloud-init RM -rf /etc/sysconfig/network-scripts/* /etc/sysconfig/network-scripts/.* + sleep 1 fi for logfile in /var/log/cloud-init.log /var/log/cloud-init-output.log ; do @@ -208,6 +209,18 @@ ok==1 {print "ip_resolve=4"; ok=0} RM "${logfile}}" done + if getent passwd cloud-user >/dev/null; then + info "Removing user 'cloud-user' ..." + exec_cmd userdel -r cloud-user + sleep 1 + fi + + if getent group cloud-user >/dev/null; then + info "Removing group 'cloud-user' ..." + exec_cmd groupdel cloud-user + sleep 1 + fi + echo info "Doing upgrade ..." exec_cmd ${tool} --assumeyes upgrade -- 2.39.5