Bug 14139 - systemd user/groups different on opkg vs rpm images
Summary: systemd user/groups different on opkg vs rpm images
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 3.4
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 6.2 M1
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 14137
  Show dependency tree
 
Reported: 2020-12-01 11:47 UTC by Ross Burton
Modified: 2026-10-29 15:28 UTC (History)
10 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2020-12-01 11:47:26 UTC
If you build core-image-minimal with both rpms and opks and compare the images, there are some curious differences:

│ ├── ./etc/gshadow
│ │ @@ -39,10 +39,10 @@
│ │  games:*::
│ │  shutdown:*::
│ │  users:*::
│ │  systemd-bus-proxy:!::
│ │  systemd-timesync:!::
│ │  systemd-resolve:!::
│ │  systemd-network:!::
│ │ -systemd-journal:x::
│ │ +systemd-journal:!::
│ │  messagebus:!::
│ │  nogroup:*::
│ ├── ./etc/shadow
│ │ @@ -11,13 +11,13 @@
│ │  uucp:*::0:99999:7:::
│ │  proxy:*::0:99999:7:::
│ │  www-data:*::0:99999:7:::
│ │  backup:*::0:99999:7:::
│ │  list:*::0:99999:7:::
│ │  irc:*::0:99999:7:::
│ │  gnats:*::0:99999:7:::
│ │ -systemd-bus-proxy:!::0:99999:7:::
│ │ -systemd-timesync:!::0:99999:7:::
│ │ -systemd-resolve:!::0:99999:7:::
│ │ -systemd-network:!::0:99999:7:::
│ │ -messagebus:!::0:99999:7:::
│ │ +systemd-bus-proxy:!:::::::
│ │ +systemd-timesync:!:::::::
│ │ +systemd-resolve:!:::::::
│ │ +systemd-network:!:::::::
│ │ +messagebus:!:::::::
│ │  nobody:*::0:99999:7:::

These files should be identical.
Comment 1 Ross Burton 2020-12-01 12:11:15 UTC
There's a pattern:

RPM has:

systemd-journal:!::

systemd-bus-proxy:!:::::::
systemd-timesync:!:::::::
systemd-resolve:!:::::::
systemd-network:!:::::::
messagebus:!:::::::

OPKG and DPKG have:

systemd-journal:x::
systemd-bus-proxy:!::0:99999:7:::
systemd-timesync:!::0:99999:7:::
systemd-resolve:!::0:99999:7:::
systemd-network:!::0:99999:7:::
messagebus:!::0:99999:7:::
Comment 2 Ross Burton 2020-12-03 15:41:14 UTC
My guess is that this is somewhere deep in the rootfs generation, and is not specific to systemd.  My test image was core-image-minimal which doesn't have many users in the image.
Comment 3 Louis Rannou 2023-06-08 14:08:56 UTC
According to the useradd manual, system users should have no aging information (0 is the minimum password age, 99999 the maximum and 7 the warning period).

In that way, it does mean the rpm is more correct than the ipk.

But if you look at the whole file (not only the diff), it appears that most of system users contain aging information in both ipk and rpm.

It looks like it really depends on the distribution. On my personal archlinux, there is no aging information in /etc/shadow. On my debian/ubuntu containers, there are when I install a package such as avahi-daemon. There are none if I run the useradd command manually. I haven't tried on Fedora.

So far, I looked at the rpm and ipk packages and I found no difference in the the install scripts. They both call the useradd command with the PSEUDO prefix. I did not find any relevant difference in the recipe-sysroot-native.

I suspect something hidden occurs inside ipk/deb packages.
Comment 4 Louis Rannou 2023-06-08 14:18:14 UTC
I think we can make the relations below:

1. Packages defined in base-passwd => have aging information (no difference between ipk and rpm)

2. Normal packages created with useradd through the class useradd => have aging information (expected behavior)

3. System packages created with useradd through the class useradd (with option --system):
  rpm:  no aging information
  ipk:  have aging information
Comment 5 Randy MacLeod 2023-07-26 21:22:02 UTC
Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.
Comment 6 Trevor Gamblin 2023-09-14 16:37:22 UTC
Moved to M4.
Comment 7 Randy MacLeod 2023-10-30 15:29:12 UTC
Bulk move to 5.0 M1. -- Randy
Comment 8 Randy MacLeod 2023-12-21 23:28:29 UTC
Bulk move of 52 5.0-M1 bugs to M2.
Comment 9 Randy MacLeod 2024-01-25 14:28:46 UTC
Bulk move of bugs owned by "unassigned" from 5.0-M2 to 5.0-M3.
Comment 10 Randy MacLeod 2024-02-22 19:53:22 UTC
Bulk move of bugs from 5.0-M3 to 5.99.
The bugs in this list are all unassigned and are ones that I consider to be nice to do some time but not essential track from milestone to milestone in 5.0 or 5.1. We agreed on this bug handling approach in the YP bug review on Feb 22, 2024.

If you disagree, please move back to a 5.[012...]-M* milestone.
Comment 11 Randy MacLeod 2026-04-23 15:30:19 UTC
Ross will check if it's still happening on master.
Comment 12 Ross Burton 2026-04-23 16:34:08 UTC
Confirmed with almost-6.0.

deb and ipkg generate /etc/shadow lines that look like this for systemd:

systemd-network:!:15069:0:99999:7:::

whereas rpm generates:

systemd-network:!:15069::::::
Comment 13 Ross Burton 2026-04-24 16:14:47 UTC
So the difference is that when useradd runs, rpm images have /etc/shadow but ipk/deb images do not.
Comment 14 Ross Burton 2026-04-24 16:56:43 UTC
/etc/shadow is created by the shadow package's postinst calling pwconf. With RPM builds this happens quite early, but it does not happen before other packages using useradd with ipk.