From fcaac9dc5ba211b841b8457b1107b51ec1c63c54 Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Wed, 8 Jul 2020 08:32:10 -0700 Subject: [PATCH 1/2] add ability for uninstall script to remove etcd user Signed-off-by: Brian Downs --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 67da5f777c..0ed0805e57 100755 --- a/install.sh +++ b/install.sh @@ -637,6 +637,8 @@ rm -rf "${BASE_DIR}" rm -rf /var/lib/kubelet rm -f ${BIN_DIR}/rke2 rm -f ${KILLALL_RKE2_SH} + +userdel etcd EOF ${SUDO} chmod 755 "${UNINSTALL_RKE2_SH}" From 8bd0949e30e6b4955f464fe5176bbb52ca553b8e Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Wed, 8 Jul 2020 09:37:09 -0700 Subject: [PATCH 2/2] remove created groups and rke2 user Signed-off-by: Brian Downs --- install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 0ed0805e57..5e0512f79f 100755 --- a/install.sh +++ b/install.sh @@ -638,7 +638,13 @@ rm -rf /var/lib/kubelet rm -f ${BIN_DIR}/rke2 rm -f ${KILLALL_RKE2_SH} -userdel etcd +for u in etcd rke2; do + if id -u \${u} 2>/dev/null; then + userdel \${u} + groupdel \${u} + fi +done + EOF ${SUDO} chmod 755 "${UNINSTALL_RKE2_SH}"