sysinv: inherit useradd to add user and group 38/3538/1
authorJackie Huang <jackie.huang@windriver.com>
Wed, 29 Apr 2020 07:55:49 +0000 (15:55 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Wed, 29 Apr 2020 13:08:35 +0000 (21:08 +0800)
- 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 <jackie.huang@windriver.com>
Change-Id: Ie0639fb8d2451fc49bc79de99ee3ebfea3c508e8

meta-stx/conf/distro/poky-stx.conf
meta-stx/recipes-core/stx-config/sysinv.inc
meta-stx/recipes-extended/rpcbind/rpcbind_%.bbappend [new file with mode: 0644]
meta-stx/recipes-networking/net-snmp/net-snmp_%.bbappend

index 119c416..fbd20f6 100644 (file)
@@ -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; \
index 34fbb25..70e4eff 100644 (file)
@@ -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 (file)
index 0000000..a0f0523
--- /dev/null
@@ -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"
index 6ef67f5..889b8b5 100644 (file)
@@ -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"