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 adc
root 33633 0.0 0.0 2248 496 ? S Mar30 0:00 runsv /etc/sv/adc
adc-user 33635 25.9 0.0 5869460 190620 ? Sl Mar30 266:33 /usr/local/adc/adc
root 927487 0.0 0.0 6372 708 pts/0 S+ 15:28 0:00 grep --color=auto adc
When we lookup the ID for
adc-user
, the UID tied to that user inside the container is 1001
.root@sg6060-n1:~ # id adc-user
uid=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 adc
root 45444 0.0 0.0 2248 496 ? S Mar30 0:00 runsv /etc/sv/adc
1001 45446 25.9 0.0 5869460 190520 ? Sl Mar30 266:39 /usr/local/adc/adc
root 1201545 0.0 0.0 3240 712 pts/0 S+ 15:29 0:00 grep --color=auto adc
In 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/local
adc-user:x:1001:1000::/usr/local/adc:/bin/bash
ldr-user:x:1002:1000::/usr/local/ldr:/bin/bash
cms-user:x:1003:1000::/usr/local/cms:/bin/bash
nms-user:x:1004:1000::/usr/local/nms:/bin/bash
ams-user:x:1005:1000::/usr/local/ams:/bin/bash
ssm-user:x:1006:1000::/usr/local/ssm:/bin/bash
clb-user:x:1007:1000::/usr/local/clb:/bin/bash
cmn-user:x:1008:1000::/usr/local/cmn:/bin/bash
arc-user:x:1009:1000::/usr/local/arc:/bin/bash
mgr-user:x:1011:1000::/usr/local/servermanager:/bin/bash
mgr-pass:x:1012:1000::/usr/local/servermanager:/bin/false
dds-user:x:1013:1000::/usr/local/dds:/bin/bash
cts-user:x:1016:1000::/usr/local/cts:/bin/bash
jaeger-user:x:1025:1000::/usr/local/jaeger:/bin/bash
lambda-user:x:1026:1000::/usr/local/lambda:/bin/bash
gpt-user:x:1500:1500::/usr/local/gpt:/bin/false
ams-client:x:60000:65534::/usr/local/ams:/bin/b