diff mbox series

[1/1] chrony: add group argument to useradd command

Message ID 20260518101712.2714997-1-adam.duskett@amarulasolutions.com
State New
Headers show
Series [1/1] chrony: add group argument to useradd command | expand

Commit Message

Adam Duskett May 18, 2026, 10:17 a.m. UTC
If privdrop is enabled, the following error happens during the build process:
useradd: group chronyd exists - if you want to add this user to that group, use -g.

Several other recipes have added "-g $somegroup" to USERADD_PARAM, and as such,
chrony should follow suit.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
 meta-networking/recipes-support/chrony/chrony_4.8.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/chrony/chrony_4.8.bb b/meta-networking/recipes-support/chrony/chrony_4.8.bb
index a7fc73e081..837f2e073f 100644
--- a/meta-networking/recipes-support/chrony/chrony_4.8.bb
+++ b/meta-networking/recipes-support/chrony/chrony_4.8.bb
@@ -47,7 +47,7 @@  inherit update-rc.d systemd pkgconfig
 # Add chronyd user if privdrop packageconfig is selected
 inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)}
 USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}"
-USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /sbin/nologin chronyd;', '', d)}"
+USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M -g chronyd --shell /sbin/nologin chronyd;', '', d)}"
 GROUPADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system chronyd', '', d)}"
 
 # Configuration options: