Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
remove omsagent user from primary group of omiusers during uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
NarineM committed Mar 8, 2024
1 parent 7eaffda commit 7365aeb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions installer/datafiles/linux.data
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7365aeb

Please sign in to comment.