On systemd systems the UID boundaries are not user configuration… – Info Linux
From looking at the systemd source, it appears to be setting a build config option SYSTEM_UID_MAX from the build machines /etc/login.defs SYS_UID_MAX value (with default 999 if missing) — so the max is being set at compile time.
That right? Here is the code from the meson config file:
system_uid_max = get_option('system-uid-max')
if system_uid_max == -1
system_uid_max = run_command(
awk,
'/^s*SYS_UID_MAXs+/ { uid=$2 } END { print uid }',
'/etc/login.defs').stdout().strip()
if system_uid_max == ''
system_uid_max = 999
else
system_uid_max = system_uid_max.to_int()
endif
endif
In the fallback case, it just shelling out an Awk job to look at /etc/login.defs
. As the main case, that would be wrong. Assuming that it is right to get this info from some login.defs
, you have to look at that login.defs
which is in the target sysroot, not the build machine’s own login.defs
.
(And that means that the file has to exist in the target sysroot, so in a distro build setting, the build of systemd
has to have a dependency on whatever package installs that file into that sysroot.)
Article Prepared by Ollala Corp