From 7ba5a6ce373782752bb0da8aa0d3e038dc057396 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Tue, 19 May 2020 11:27:34 +0800 Subject: [PATCH] fm-mgr: fix to avoid useradd error There is an issue in Yocto that the useradd dependency is not corretly handled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13904 This fix is a work around to move the useradd option "-G snmpd" to image level and use usermod command instead. Issue-ID: INF-120 Signed-off-by: Jackie Huang Change-Id: I4d9671ab11fa2d33e69359ada5395be04ec3e7c5 --- meta-stx/conf/distro/files/ks/poky_stx_aio_ks.cfg | 1 + meta-stx/conf/distro/poky-stx.conf | 1 + meta-stx/recipes-core/stx-fault/fm-mgr.inc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-stx/conf/distro/files/ks/poky_stx_aio_ks.cfg b/meta-stx/conf/distro/files/ks/poky_stx_aio_ks.cfg index 3fadb48..92460fb 100644 --- a/meta-stx/conf/distro/files/ks/poky_stx_aio_ks.cfg +++ b/meta-stx/conf/distro/files/ks/poky_stx_aio_ks.cfg @@ -640,6 +640,7 @@ usermod -a -G sys_protected www usermod -a -G sys_protected nfv usermod -a -G sys_protected patching usermod -a -G sys_protected haproxy +usermod -a -G snmpd fm usermod -P root root # Extend path variable for sysadmin diff --git a/meta-stx/conf/distro/poky-stx.conf b/meta-stx/conf/distro/poky-stx.conf index 0c09985..869866a 100644 --- a/meta-stx/conf/distro/poky-stx.conf +++ b/meta-stx/conf/distro/poky-stx.conf @@ -74,6 +74,7 @@ EXTRA_USERS_PARAMS_CONFIG = "\ usermod -a -G sys_protected nfv; \ usermod -a -G sys_protected patching; \ usermod -a -G sys_protected haproxy; \ + usermod -a -G snmpd fm; \ usermod -P root root; \ \ groupadd -r -g 128 nscd; \ diff --git a/meta-stx/recipes-core/stx-fault/fm-mgr.inc b/meta-stx/recipes-core/stx-fault/fm-mgr.inc index 1c07da8..2a14cf3 100644 --- a/meta-stx/recipes-core/stx-fault/fm-mgr.inc +++ b/meta-stx/recipes-core/stx-fault/fm-mgr.inc @@ -54,7 +54,7 @@ FILES_fm-mgr = " \ inherit useradd USERADD_PACKAGES = "fm-mgr" -USERADD_PARAM_fm-mgr = "-r -g fm -G snmpd -u 195 -d /var/lib/fm -s /sbin/nologin -c 'fm-mgr' fm" +USERADD_PARAM_fm-mgr = "-r -g fm -u 195 -d /var/lib/fm -s /sbin/nologin -c 'fm-mgr' fm" GROUPADD_PARAM_fm-mgr = "-r -g 195 fm" RDEPENDS_fm-mgr += "net-snmp-server-snmpd" -- 2.16.6