メインコンテンツへスキップ

ベースOSでStorageGRIDサービスがランダムなユーザ名に割り当てられる理由

Views:
2
Visibility:
Public
Votes:
0
Category:
storagegrid
Specialty:
esg
Last Updated:

環境

StorageGRID

回答

この動作は、LinuxとDockerの間で発生します。コンテナ内(この場合はStorageGRID)では、サービスはコンテナ内でのみ認識されるユーザ名に関連付けられます。SAIDコンテナはUIDにも関連付けられています。
 
ベースOSでは、コンテナ内のユーザーは不明ですが、サービスの同じIDが使用されます。ただし、DockerがベースOS内でUIDを検索すると、プルされます。
その特定のUIDに関連付けられているすべてのユーザ。例:
 
コンテナの内部を見ると、adc  サービスは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
 
adc-user のIDを検索すると、コンテナ内でそのユーザに関連付けられているUIDが1001 になります。
 
root@sg6060-n1:~ # id adc-user
uid=1001(adc-user) gid=1000(bycast) groups=1000(bycast)
 
ベースOSに切り替えてadcgrepすると、adcユーザ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
 
この場合 、ベースOSではUID1001 にユーザが関連付けられていないため、1001 ユーザとして表示されます。ただし、ベースOS側でこのUIDに関連付けられているユーザー名( user234 など)があれば、user234 が表示されます。これは、Base OSがコンテナ内で利用可能なユーザを認識しないため、 問題のUIDに関連付けられているユーザを一覧表示するためです。

追加情報

コンテナ内のUIDは、次のように/etc/passwd で確認できます(一般的なユーザのリスト)。UIDは「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
 

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.