From d9f53a89a83cac2fd276c07f314c56b1a154b122 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Wed, 29 Apr 2020 15:55:49 +0800 Subject: [PATCH] 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. Signed-off-by: Jackie Huang Signed-off-by: Babak Sarashki --- meta-stx-distro/conf/distro/poky-stx.conf | 3 --- meta-stx-flock/stx-config/sysinv.bb | 6 +++++- meta-stx-integ/recipes-extended/rpcbind/rpcbind_%.bbappend | 2 ++ .../recipes-protocols/net-snmp/net-snmp_%.bbappend | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 meta-stx-integ/recipes-extended/rpcbind/rpcbind_%.bbappend diff --git a/meta-stx-distro/conf/distro/poky-stx.conf b/meta-stx-distro/conf/distro/poky-stx.conf index f91df17..24c99b8 100644 --- a/meta-stx-distro/conf/distro/poky-stx.conf +++ b/meta-stx-distro/conf/distro/poky-stx.conf @@ -38,9 +38,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-flock/stx-config/sysinv.bb b/meta-stx-flock/stx-config/sysinv.bb index 49746d0..e9a9bae 100644 --- a/meta-stx-flock/stx-config/sysinv.bb +++ b/meta-stx-flock/stx-config/sysinv.bb @@ -52,10 +52,14 @@ RDEPENDS_${PN}_append = " \ gptfdisk \ " -inherit setuptools python-dir systemd +inherit setuptools python-dir systemd useradd SYSTEMD_PACKAGES += "${PN}" SYSTEMD_SERVICE_${PN} = "sysinv-api.service sysinv-conductor.service" +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" + do_install_append() { install -d -m 755 ${D}${sysconfdir}/goenabled.d diff --git a/meta-stx-integ/recipes-extended/rpcbind/rpcbind_%.bbappend b/meta-stx-integ/recipes-extended/rpcbind/rpcbind_%.bbappend new file mode 100644 index 0000000..3f700b3 --- /dev/null +++ b/meta-stx-integ/recipes-extended/rpcbind/rpcbind_%.bbappend @@ -0,0 +1,2 @@ +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-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend b/meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend index c3d05ea..7ecb0a9 100644 --- a/meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend +++ b/meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend @@ -1,5 +1,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"