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

user root directory could be configurable #27959

Closed
Louson opened this issue Jun 7, 2023 · 3 comments
Closed

user root directory could be configurable #27959

Louson opened this issue Jun 7, 2023 · 3 comments
Labels
needs-discussion 🤔 pid1 RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@Louson
Copy link

Louson commented Jun 7, 2023

Component

systemd

Is your feature request related to a problem? Please describe

As described in sysusers.d/basic.conf.in, the root home directory is /root. Some distributions use /home/root (I have a distribution built on yocto)

Could this be defined in the build configuration ?

Describe the solution you'd like

It's possible to replace the line:
u root 0 "Super User" /root

with
u root 0 "Super User" {{ROOT_HOME_DIRECTORY}}

and set ROOT_HOME_DIRECTORY as '/root' by default

Describe alternatives you've considered

No response

The systemd version you checked that didn't have the feature you are asking for

250.5-r0

@Louson Louson added the RFE 🎁 Request for Enhancement, i.e. a feature request label Jun 7, 2023
@github-actions github-actions bot added the pid1 label Jun 7, 2023
@poettering
Copy link
Member

Uh, I am not convinced. That's a really bad idea, given that /home/ is a late boot mount usually.

I am not convinced we should allow this. If people want this they can make /root a symlink or bind mount, or patch this downstream.

But I am absolutely not convinced that we should support this as first class concept, because it#s inherently a bad idea, I am sure, and we shouldn't make bad ideas easy.

@Louson
Copy link
Author

Louson commented Jun 7, 2023

I agree with you for most standards distribution.

However, the yocto manual says:

ROOT_HOME ??= "/home/root"
This default value is likely used because some embedded solutions prefer to have a read-only root filesystem and prefer to keep writeable data in one place.

And I also agree to that.

I am not convinced it worth to support that it systemd (I also don't know how much work would that be). It's good to have your point of view.

Thanks,
Louis

@poettering
Copy link
Member

Well, the root user is really the only user you shold be able to log into safely even if /home cannot be mounted. Which is a property that is a lot more important than the writability.

Anyway, note that te above is just about a fallback in case your /etc/passwd got lost. I am pretty sure that even if yocto wants to do its own thing, it can do so easily by just populating /etc/passwd the way it wants.

Anyway, closing this, as I am sure this is really not desirable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion 🤔 pid1 RFE 🎁 Request for Enhancement, i.e. a feature request
Development

No branches or pull requests

2 participants