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

Add notice on possible missing cache dir and link to cache instr. #146

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

braun-steven
Copy link
Contributor

Some distributions (e.g., Arch, Fedora, OpenSUSE Tumbleweed) happen to be missing the setup of /var/cache/tuigreet, which leads to the --remember* options not working without running the cache instructions that are only mentioned for manual installs.

Some distributions (e.g. Arch, Fedora, OpenSUSE Tumbleweed) happen to be missing
the setup of /var/cache/tuigreet which leads to the --remember* options not
working.
@apognu
Copy link
Owner

apognu commented Jun 5, 2024

This is a good idea.

Now, you say that the package installs on Arch are missing the directory, that does not seem right to me, since they should all contain the tmpfiles.d definition to have it created. Which package did you encounter this with?

@apognu apognu self-assigned this Jun 5, 2024
@apognu apognu added the documentation Improvements or additions to documentation label Jun 5, 2024
@braun-steven
Copy link
Contributor Author

Sorry, I think something went wrong on my initial test for Arch. I've tested them via distrobox (podman):

Arch

$ distrobox create --name tuigreet-test-cache --pull -i quay.io/toolbx/arch-toolbox:latest
$ distrobox enter tuigreet-test-cache -- sudo pacman -S --noconfirm greetd-tuigreet
$ distrobox enter tuigreet-test-cache -- ls -lha /var/cache
total 0
drwxr-xr-x 1 root    root    44 Jun  5 11:10 .
drwxr-xr-x 1 root    root    22 May 27 02:09 ..
drwx------ 1 root    root    18 Jun  5 11:12 ldconfig
drwxr-xr-x 1 root    root     0 May 27 02:09 man
drwxr-xr-x 1 root    root     6 Jan  1 20:05 pacman
drwx------ 1 root    root     0 May 27 02:09 private
drwxr-xr-x 1 greeter greeter  0 Jun  5 11:10 tuigreet  # <--------- Works

Fedora 40

$ distrobox create --name tuigreet-test-cache-fedora --pull -i registry.fedoraproject.org/fedora-toolbox:40
$ distrobox enter tuigreet-test-cache-fedora -- sudo dnf install -y tuigreet
$ distrobox enter tuigreet-test-cache-fedora -- ls -lha /var/cache
total 0
drwxr-xr-x 1 root root  22 Jun  5 07:48 .
drwxr-xr-x 1 root root  28 Jun  5 07:48 ..
drwxr-xr-x 1 root root   0 Jan 24 01:00 bpf
drwxr-xr-x 1 root root 440 Jun  5 11:17 dnf
drwx------ 1 root root  18 Jun  5 11:16 ldconfig
drwxr-xr-x 1 root root  14 Jun  5 07:48 libX11
drwxr-xr-x 1 root root   0 Jan 29 01:00 man
drwx------ 1 root root   0 Jun  5 07:48 private

OpenSUSE Tumbleweed

$ distrobox create --name tuigreet-test-cache-opensuse --pull -i registry.opensuse.org/opensuse/distrobox:latest
$ distrobox enter tuigreet-test-cache-opensuse -- sudo zypper install -y tuigreet
$ distrobox enter tuigreet-test-cache-opensuse -- ls -lha /var/cache
total 0
drwxr-xr-x 1 root root   8 Jun  1 11:20 .
drwxr-xr-x 1 root root  34 Jun  1 11:19 ..
drwxrwx--- 1 root lp     0 Feb 26 11:48 cups
drwxr-xr-x 1 root root   0 Mar  9 20:58 fontconfig
drwxr-xr-x 1 root root 190 Jun  1 11:19 gio-2.0
drwx------ 1 root root  18 Jun  1 11:20 ldconfig
drwxr-xr-x 1 man  man  294 Jun  1 11:20 man
drwxr-xr-x 1 root root  44 Jun  5 11:19 zypp

So Arch works, but Fedora and OpenSUSE don't.

@apognu
Copy link
Owner

apognu commented Jun 5, 2024

Okay, makes more sense. 🙏 I will merge this, and see if I can contact the maintainers for the packages in the other distributions.

@braun-steven
Copy link
Contributor Author

Awesome, thank you!

I tried to add a function that ensures that the cache dir exists before writes to the cache happen (e.g. here

let _ = fs::write(LAST_USER_USERNAME, &username.value);
) only to find out that the tuigreet process, started by greetd, doesn't have permissions to create directories in /var/cache. I guess there is no simply workaround for this, or any other place (besides /tmp) which the greetd process has rw access to, right? This would alleviate the need for package maintainers to ensure that the directory exists and has the correct permissions.

@apognu
Copy link
Owner

apognu commented Jun 5, 2024

Yes, as far as I know, there is no way to create it ourself because of the user the greeter runs as. So we are dependent on the packagers.

@apognu apognu merged commit 4ca2916 into apognu:master Jun 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants