From: Jackie Huang Date: Wed, 29 Apr 2020 07:55:49 +0000 (+0800) Subject: sysinv: inherit useradd to add user and group X-Git-Tag: bronze-rc0~51 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=b071d20bab0cb3cf8cf432de7fce333c14328b66;p=pti%2Frtp.git sysinv: inherit useradd to add user and group - stx 3.0 needs the 'sysinv' user/group created with id 168, which maybe occupied by other user/group, so change to inherit useradd in sysinv recipe to avoid such issue. - reset the id for rpc and snmpd to align stx3.0 and avoid conflicts. Issue-ID: INF-61 Signed-off-by: Jackie Huang Change-Id: Ie0639fb8d2451fc49bc79de99ee3ebfea3c508e8 --- diff --git a/meta-stx/conf/distro/poky-stx.conf b/meta-stx/conf/distro/poky-stx.conf index 119c416..fbd20f6 100644 --- a/meta-stx/conf/distro/poky-stx.conf +++ b/meta-stx/conf/distro/poky-stx.conf @@ -54,9 +54,6 @@ EXTRA_USERS_PARAMS_CONFIG = "\ useradd -m -g sys_protected -G root \ -d /home/sysadmin -p ${SYSADMIN_P} \ -s /bin/sh sysadmin; \ - useradd -p '' sysinv; \ - groupadd sysinv; \ - usermod -a -G sysinv sysinv; \ useradd -p '' ceph; \ groupadd ceph; \ usermod -a -G ceph ceph; \ diff --git a/meta-stx/recipes-core/stx-config/sysinv.inc b/meta-stx/recipes-core/stx-config/sysinv.inc index 34fbb25..70e4eff 100644 --- a/meta-stx/recipes-core/stx-config/sysinv.inc +++ b/meta-stx/recipes-core/stx-config/sysinv.inc @@ -18,7 +18,11 @@ PACKAGES += " sysinv" RDEPENDS_sysinv += " python" RDEPENDS_sysinv += " bash" -inherit setuptools distutils python-dir systemd +inherit setuptools distutils python-dir systemd useradd + +USERADD_PACKAGES = "sysinv" +USERADD_PARAM_sysinv = "-r -g sysinv -u 168 -d /var/lib/sysinv -s /sbin/nologin -c 'sysinv Daemons' sysinv" +GROUPADD_PARAM_sysinv = "-r -g 168 sysinv" DEPENDS += " \ python-pbr-native \ diff --git a/meta-stx/recipes-extended/rpcbind/rpcbind_%.bbappend b/meta-stx/recipes-extended/rpcbind/rpcbind_%.bbappend new file mode 100644 index 0000000..a0f0523 --- /dev/null +++ b/meta-stx/recipes-extended/rpcbind/rpcbind_%.bbappend @@ -0,0 +1,17 @@ +# +## Copyright (C) 2019 Wind River Systems, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +USERADD_PARAM_${PN} = "-r -g rpc -u 32 -d /var/lib/rpcbind -s /sbin/nologin -c 'Rpcbind Daemons' rpc" +GROUPADD_PARAM_${PN} = "-r -g 32 rpc" diff --git a/meta-stx/recipes-networking/net-snmp/net-snmp_%.bbappend b/meta-stx/recipes-networking/net-snmp/net-snmp_%.bbappend index 6ef67f5..889b8b5 100644 --- a/meta-stx/recipes-networking/net-snmp/net-snmp_%.bbappend +++ b/meta-stx/recipes-networking/net-snmp/net-snmp_%.bbappend @@ -16,5 +16,5 @@ inherit useradd USERADD_PACKAGES = "net-snmp-server-snmpd" -USERADD_PARAM_net-snmp-server-snmpd = "-r -g snmpd -u 169 -d /usr/share/snmp -s /sbin/nologin -c 'net-snmp' snmpd" -GROUPADD_PARAM_net-snmp-server-snmpd = "-r -g 169 snmpd" +USERADD_PARAM_net-snmp-server-snmpd = "-r -g snmpd -d /usr/share/snmp -s /sbin/nologin -c 'net-snmp' snmpd" +GROUPADD_PARAM_net-snmp-server-snmpd = "-r snmpd"