From 7365aeb072bab405d4d9cf7a0bc2ba14625cfd5f Mon Sep 17 00:00:00 2001 From: Narine Mossikyan Date: Thu, 7 Mar 2024 19:59:32 -0800 Subject: [PATCH] remove omsagent user from primary group of omiusers during uninstall --- installer/datafiles/linux.data | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/installer/datafiles/linux.data b/installer/datafiles/linux.data index b87d2c8f3..9a3ac9274 100644 --- a/installer/datafiles/linux.data +++ b/installer/datafiles/linux.data @@ -74,8 +74,8 @@ if [ $? -ne 0 ]; then useradd -r -c "OMS agent" -d /var/opt/microsoft/omsagent/run -g omsagent -s /bin/bash omsagent fi -# Ensure omsagent is in the omiusers group, but leave omsagent as a group -# Ensure omsagent is in the omi group as well +# Ensure omsagent is in the omiusers primary group, but leave omsagent as a group +# Ensure omsagent is in the omi secondary group as well /usr/sbin/usermod -g omiusers -a -G omi omsagent 1> /dev/null 2> /dev/null # Add the 'nxautomation' group if it does not already exist @@ -170,6 +170,10 @@ if ${{PERFORMING_UPGRADE_NOT}}; then echo "Removing omsagent from the omi group ..." gpasswd -d omsagent omi + # Remove omsagent from the omiusers group + echo "Removing omsagent from the omiusers group ..." + gpasswd -d omsagent omiusers + # Remove the service accounts echo "Deleting nxautomation service account ..." userdel nxautomation 2> /dev/null