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

LightDM doesn't properly install within a container #4369

Closed
jerbmega opened this issue Apr 17, 2023 · 4 comments · Fixed by #4399
Closed

LightDM doesn't properly install within a container #4369

jerbmega opened this issue Apr 17, 2023 · 4 comments · Fixed by #4399

Comments

@jerbmega
Copy link

I've been advised to move this here from fedora-silverblue/issue-tracker#452.

Host system details

No "host" in this case, this is in an OCI build.

Expected vs actual behavior

LightDM is not properly installed when added within a Containerfile.
Adding lightdm in a Containerfile results in a build that succeeds, but cannot properly run LightDM, as the user is not made due to an error. I also get a dbus-daemon error within the container. I've reproduced this on both Fedora 37 and 38.

The package works properly when layering it over an existing installation, implying this is solely a container issue.

I get the following error during build:

error: Found argument '-M' which wasn't expected, or isn't valid in this context

	If you tried to supply `-M` as a value rather than a flag, use `-- -M`

USAGE:
    useradd [OPTIONS] <username>

For more information try --help
Installing: lightdm-1.32.0-2.fc37.x86_64 (fedora)
dbus-daemon: no process found

When running lightdm --debug in the resulting install, the following relevant debug output is noted:

...
[+0.10s] WARNING: Could not enumerate user data directory /var/lib/lightdm-data: Error opening directory `/var/lib/lightdm-data`: No such file or directory
-snip-
[+1.42s] DEBUG: Session pid=1225: Started with service `lightdm-greeter`, username `lightdm`
Failed to get information on user lightdm: Success
[+1.46s] DEBUG: Session pid=1225: Authentication complete with return value 10: User not known to the underlying authentication module
...

Expected:
The LightDM user should be properly set up during the build process.

Steps to reproduce it

  • Add rpm-ostree install lightdm into a Containerfile. The build will succeed but will not run properly once deployed, with the above symptoms. This can be reproduced both via a local Podman build as well as Github Actions.
@travier
Copy link
Member

travier commented Apr 18, 2023

Notes from investigation in the parent ticket:

Error opening directory `/var/lib/lightdm-data`: No such file or directory

This should be converted to a tmpfiles.d config file instead of being manually created in the package: https://src.fedoraproject.org/rpms/lightdm/blob/rawhide/f/lightdm.spec#_166


error: Found argument '-M' which wasn't expected, or isn't valid in this context

	If you tried to supply `-M` as a value rather than a flag, use `-- -M`

It's unclear to me why this would fail in rpm-ostree while this works in the classic RPM case.

@jerbmega
Copy link
Author

It looks like the template Containerfile I started from deletes the contents of /var and /tmp from the container before running a commit, so that much isn't an ostree issue.

@travier
Copy link
Member

travier commented Apr 18, 2023

I've updated my comment. It's expected that /var & /tmp are cleared out as they are not part of the ostree commit. Packages should use systemd tmpfiles.d config files to setup files in those directories.

@jerbmega jerbmega reopened this Apr 22, 2023
@jerbmega
Copy link
Author

Mobile misclick, sorry

cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue May 8, 2023
I believe this is implied by `--system` anyways, but at least
one spec file was discovered to be using this in the wild.

Closes: coreos#4369
lukewarmtemp pushed a commit to lukewarmtemp/rpm-ostree that referenced this issue Jun 7, 2023
I believe this is implied by `--system` anyways, but at least
one spec file was discovered to be using this in the wild.

Closes: coreos#4369
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

Successfully merging a pull request may close this issue.

2 participants