Resolution

How to change UID of xray user

AuthorFullName__c
Prasanna Narayana
articleNumber
000004511
ft:sourceType
Salesforce
FirstPublishedDate
2019-07-17T16:25:20Z
lastModifiedDate
2023-01-22T11:05:32Z
VersionNumber
2

1. Stop Xray and all the microservices using the command :

./xray.sh stop all

2. Change the UID (For this test we are changing it to 2000) of xray user using the command : 

usermod -u 2000 xray  

3. We have to change the ownership of the directories to reflect the new UID. We need to use the chown command on the following directories.

chown -R xray:xray /var/opt/jfrog/xray/data/

chown -R xray:xray /opt/jfrog/xray/

Before using the chown command, please make sure the contents in these directories are owner by xray user before hand (You can use the command ls -n to check the user and UID of a file/directory). If there are some files which are owner by root user, please keep it as is and do not chown those files/directories.

4. You can now go ahead and start Xray using the command :

./xray.sh start all 

These steps should successfully change the UID of the xray user in your existing set up.

Upgrading: After a successful upgrade, the UID of the xray user will be changed back to 995 so we can perform the above mentioned steps again to successfully change the UID and get Xray server up and running. Be sure to include these steps in any instrumentation you might be using for upgrades.