Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use systemd-sysusers #3191

Closed
Mathnerd314 opened this issue Jul 5, 2014 · 8 comments
Closed

Use systemd-sysusers #3191

Mathnerd314 opened this issue Jul 5, 2014 · 8 comments

Comments

@Mathnerd314
Copy link
Contributor

Systemd 215 is released, and has a new way of configuring system user accounts which is much nicer than our current shell-script approach. Systemd should be updated to 215 and then the user/groups creation code changed to write to a systemd-sysusers configuration file.

@Mathnerd314
Copy link
Contributor Author

Note that systemd-sysusers is limited to configuring password-less disabled-login users; so if /etc is readonly (#3192) we will need to use an alternate method of configuration for other (normal) users, e.g. https://github.com/aperezdc/nss-altfiles.

@wmertens
Copy link
Contributor

wmertens commented Jul 6, 2014

How do you propose to handle passwords? Should the hash be stored in
world-readable files?

@Mathnerd314
Copy link
Contributor Author

Systemd-sysusers doesn't let you specify passwords, so this issue doesn't handle them. Passworded users will be elsewhere, e.g. with altfiles they'll be in /var/lib/nss, with the typical world-readable passwd and root-readable shadow split, and you can handle those files and the passwords they contain any way you choose, either with Nix or by hand. Or you can use a bigger solution, e.g. sssd or LDAP.

@Profpatsch
Copy link
Member

While using an “official” way to do declarative users would be nice, I believe our current scripts are quite mature by now.

Are there any good arguments for switching? My impressions are:

  • It seems to be a quite small feature in systemd, how bug-free is it really?
  • The manpage for sysusers.d doesn’t exist on my system
  • Yet another thing that depends on systemd

@Mathnerd314, do you want to implement that? Otherwise it vote for close.

@joachifm
Copy link
Contributor

joachifm commented Mar 6, 2016

I have used sysusers on non-NixOS setups, works as advertised in my experience. Whether it would bring anything to NixOS is unclear, apart from offloading some logic onto systemd (and thus also having to abide by their rules for how system users are to be handled).

@Mathnerd314
Copy link
Contributor Author

The scripts are not what I would call "mature"; they are littered with "FIXME". That being said, systemd-sysusers cannot make ordinary users, so the perl script seems preferable at the moment.

@Profpatsch
Copy link
Member

Maybe @edolstra is in favor of a rewrite?

@bb010g
Copy link
Contributor

bb010g commented Mar 17, 2024

Support for systemd-sysusers has been implemented in #270727.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants