-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
plasma5: improve kbuildsycoca activation script #45290
Conversation
* silence normal output from the command * avoid running it when the data it wants to update is encrypted * specify explicit bash in kbuildsycoca5 su command when the activation script runs at boot time, the users' default shells (typically /run/current-system/sw/bin/bash) will not be available. instead, specify an explicit store path for bash. follow-on to NixOS#42910 and NixOS#44544
Before this change, at boot, I saw errors like this for each user:
Now I'm getting errors like this for each user:
... but I'm not sure we even really want/need to do this step at boot? |
cc @bkchr |
Actually, why don't we just use a systemd service for this? Would make it a lot cleaner and avoid activationScripts, and the problems you mentioned along with it |
@infinisil good idea. |
I'm not sure I see how a systemd service would ensure that it gets run for the current user on |
Make the service config depend on something that changes when the list of application changes, then it gets restarted automatically along with the |
So the issue with activation scripts is that they run pretty early during boot (ref the issue above) so we really shouldn't be doing
A system level service will not know about the individual user variables (such as Let's say the activation script (which runs as root) was to do something like this: for d in /run/user/* ; do
touch $d/activate
done That would work for all currently logged on users, regardless of where they came from. And we then have an [Unit]
Description = Trigger user specific activation script
[Path]
PathChanged = %t/activate
Unit = nixos-activation.service And the corresponding service: [Unit]
Description = User specific activation script
[Service]
Type = oneshot
ExecStart = full_path_of_the_script_that_does_the_magic All of this is completely untested but I wanted to throw the idea out there. Comments? |
We could also use dbus of course, but this seems much simpler. |
Looping in @bkchr who wrote the initial bits for the call to kbuildsycoca. Sorry about the comment spam guys. |
Can we not use a user systemd service for this? |
Well, a system service will give us the problem with running things on behalf of users (DISPLAY for one). What I propose above is using a user systemd service that just gets triggered by the presence of a file. |
Do we need |
|
I believe this has been superseded by #47842. |
silence normal output from the command
avoid running it when the data it wants to update is encrypted
specify explicit bash in kbuildsycoca5 su command
when the activation script runs at boot time, the users' default
shells (typically /run/current-system/sw/bin/bash) will not be
available. instead, specify an explicit store path for bash.
follow-on to #42910 and #44544
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)