Why are StorageGRID services assigned to random usernames in Base OS
Applies to
StorageGRID
Answer
This behavior happens between Linux and Docker. Inside the container (in this case StorageGRID), the services are tied to a username which is only known inside the container. Said container is also tied to an UID.
In base OS, the users inside of a container are unknown but the same ID for a service is used. However, when Docker searches for the UID within Base OS it will pull
whatever user is tied to that specific UID. For example:
When we look inside the container, the
adc service is tied to adc-user.root@sg6060-n1:~ # ps aux | grep adcroot 33633 0.0 0.0 2248 496 ? S Mar30 0:00 runsv /etc/sv/adcadc-user 33635 25.9 0.0 5869460 190620 ? Sl Mar30 266:33 /usr/local/adc/adcroot 927487 0.0 0.0 6372 708 pts/0 S+ 15:28 0:00 grep --color=auto adcWhen we lookup the ID for
adc-user, the UID tied to that user inside the container is 1001.root@sg6060-n1:~ # id adc-useruid=1001(adc-user) gid=1000(bycast) groups=1000(bycast)When we switch to Base OS, and grep for
adc, it shows adc is being ran by user 1001:root@SG:~ # ps aux | grep adcroot 45444 0.0 0.0 2248 496 ? S Mar30 0:00 runsv /etc/sv/adc1001 45446 25.9 0.0 5869460 190520 ? Sl Mar30 266:39 /usr/local/adc/adcroot 1201545 0.0 0.0 3240 712 pts/0 S+ 15:29 0:00 grep --color=auto adcIn this case there was no user associated with UID
1001 in Base OS, which is why it just shows 1001 as the user. However, if there was a username associated with this UID on the Base OS side, something like user234, then it would list user234. This is because Base OS does not know what users are available within the container, so it will list what it can find associated to the UID in question.Additional Information
The UIDs in the container can be found in
/etc/passwd as seen below (list of common users). The UID is the first number after “x”:root@sg6060-n1:~ # cat /etc/passwd | grep /usr/localadc-user:x:1001:1000::/usr/local/adc:/bin/bashldr-user:x:1002:1000::/usr/local/ldr:/bin/bashcms-user:x:1003:1000::/usr/local/cms:/bin/bashnms-user:x:1004:1000::/usr/local/nms:/bin/bashams-user:x:1005:1000::/usr/local/ams:/bin/bashssm-user:x:1006:1000::/usr/local/ssm:/bin/bashclb-user:x:1007:1000::/usr/local/clb:/bin/bashcmn-user:x:1008:1000::/usr/local/cmn:/bin/basharc-user:x:1009:1000::/usr/local/arc:/bin/bashmgr-user:x:1011:1000::/usr/local/servermanager:/bin/bashmgr-pass:x:1012:1000::/usr/local/servermanager:/bin/falsedds-user:x:1013:1000::/usr/local/dds:/bin/bashcts-user:x:1016:1000::/usr/local/cts:/bin/bashjaeger-user:x:1025:1000::/usr/local/jaeger:/bin/bashlambda-user:x:1026:1000::/usr/local/lambda:/bin/bashgpt-user:x:1500:1500::/usr/local/gpt:/bin/falseams-client:x:60000:65534::/usr/local/ams:/bin/b