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

cleanup-service #18

Open
Dreick-dev opened this issue Feb 3, 2022 · 7 comments
Open

cleanup-service #18

Dreick-dev opened this issue Feb 3, 2022 · 7 comments

Comments

@Dreick-dev
Copy link

Dreick-dev commented Feb 3, 2022

I'm not sure but is the cleanup-service intended to get activated by hand? There is no hint do do so at installation, as far as I remember. Today I tried to figure out why my root-partition got bigger and bigger and analyzed it with filelight. This is what i got:
Screenshot_20220203_222536

When I looked into named modules directory I saw what it was:
Screenshot_20220203_221834

I looked into this repo and saw, that a system-service was intended to cleanup on startup. I looked for it, and saw, that it was not enabled. I triggered it by hand and of course, it took an eternity to copy - delete - copy -delete... and finally delete all copied directories.

Am I the only one who took that long to notice that? Either way, maybe it would be cool if the PKGBUILD could echo a hint to the console to activate the service.

Not a high-priority thing, but maybe a funny story and a suggestion.

@saber-nyan
Copy link
Owner

It seems that the file kernel-modules-hook.install was not added to the community repo when the package was added, so users do not see request to enable the systemd service linux-modules-cleanup.

post_install() {
cat << EOF
Please execute
$ sudo systemctl daemon-reload
$ sudo systemctl enable linux-modules-cleanup
Report any issues to:
https://github.com/saber-nyan/kernel-modules-hook/issues
~desu
EOF
}

@shibumi is it possible to enable this service when installing the package or to notify the user to enable it?

@thurstylark
Copy link

FWIW, the daemon-reload instruction is superfluous in light of the systemd-daemon-reload hook that's shipped with the systemd package.

But otherwise, yes, the package as it exists in community currently lacks a notification that enabling the cleanup service is necessary for the advertised cleanup functionality to ...function.

I doubt that enabling or starting the systemd unit on install will be possible, as that's usually considered a user's choice to make, but it might be possible to get an install script notification added to the package.

I've created a feature request with downstream to float this idea, so we'll see how that goes: https://bugs.archlinux.org/task/74592

@C0rn3j
Copy link

C0rn3j commented Mar 5, 2023

@saber-nyan Please also add the instructions to the README

https://github.com/saber-nyan/kernel-modules-hook#installation

@KAGEYAM4
Copy link

ExecStart=/bin/bash -exc 'for i in /usr/lib/modules/[0-9]*; do if [[ $${i##*/} = \'%v\' ]] || pacman -Qo "$${i}"; then continue; fi; rsync -AHXal "$${i}" /usr/lib/modules/.old/; rm -rf "$${i}"; done'

About the cleanup.service. why is it performing rsync to .old directory. Who is suppose to clean that?

Also what is the use of https://github.com/saber-nyan/kernel-modules-hook/blob/master/linux-modules-cleanup.conf, i read pre-hook, post-hook and cleanup.service. No one seems to be using this file.

@C0rn3j
Copy link

C0rn3j commented Oct 21, 2024

No one seems to be using this file.

It's in the PKGBUILD. It goes to tmpfiles.

Who is supposed to clean that?

The file you've just asked about, I imagine.

@KAGEYAM4
Copy link

@C0rn3j Thanks. Didn't knew this usecase of /usr/lib/tmpfiles.d/.

By the way all this copying back and forth (3 times - pre,post,.old). Does it increases Writes on SSDs? Or is BTRFS only copying refrences and not actually copying the whole data again and again with every rsync operation.

@C0rn3j
Copy link

C0rn3j commented Oct 21, 2024

Does it increases Writes on SSDs?

Probably. Why don't you check?

Your SSD won't explode if you write files to it, it was made for it.

Kill tests of even ancient tiny SSDs went into petabytes, stop worrying.

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