[systemd-devel] systemd-sysusers

Michael Chapman mike at very.puzzling.org
Mon Feb 5 05:56:50 UTC 2018


On Mon, 5 Feb 2018, Johannes Ernst wrote:
> It appears systemd-sysusers does not create home directories. On the 
> other hand, it picks (largely unpredictable) UIDs from a range.
>
> So I have to run systemd-sysusers, and after that, find the UID of the 
> user and chown the home directory? Or is there the equivalent of the 
> “useradd -m” flag somewhere that I’m just not seeing?

systemd-sysusers is, as the name suggests, really for _system_ users, and 
often those kinds of users don't have ordinary home directories -- that 
is, ones the user can actually write to.

However, systemd-sysusers.service is ordered before 
systemd-tmpfiles-setup.service at boot, so if you need to create a system 
user's home directory and ensure its ownership is correct, you could use a 
corresponding tmpfiles.d fragment to do so.


More information about the systemd-devel mailing list