Hi, Luca Boccassi wrote: > coreutils is a core/essential package, that is pulled in every build > chroot and so on. The functionality provided by libsystem is useful > for full systems, but not so much for build systems or other such > minimal environments.
I tend to agree with that. The coreutils programs that use libsystemd (who, users, pinky) are hardly useful in minimal environments. For instance, Alpine Linux (which is often used for such minimal environments) has only a minimal 'who' program and no 'users' and 'pinky' programs at all. > Switch usage of the library to dlopen, so that it can be built in but > runtime optional, and can be avoided if the specific functionality is > not used, gracefully. If dlopen fails, fallback to the non-systemd > method gracefully. I disagree with this approach. The situation is not that libsystemd would provide some enhanced results, compared to the non-systemd method. Rather, the situation is that the relevant distros have removed the support for the non-systemd method (by not creating a /var/tmp/utmp file in the first place — cf. Thorsten Kukuk's work <https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/>). The non-systemd method therefore returns outright broken results. In other words, what I don't like is that your proposal introduces a mode where the three programs are present (and don't fail) but are broken for all purposes. In the minimal environments that you are talking about, it is preferable if the three programs signal an error instead of returning broken results. I see two ways to achieve that: a) Minimal environments could be created with no 'who', 'users', 'pinky' programs. (For instance, the chroot environment creation routine could skip over these three programs. Or the distro could split the 'coreutils' package into 'coreutils-minimal' and 'coreutils-global' packages; 'who', 'users', 'pinky' would be contained in the latter. b) Just add the 'who', 'users', 'pinky' program to the minimal environment, without libsystemd.so. Then any invocation of 'who', 'users', 'pinky' will automatically fail, due to the missing shared library. I find either of these two approaches preferable to what you propose. Bruno
