-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
systemctl import-environment without specifying desired variables is deprecated #254
Comments
Hey! I cargo culted that line from other projects. I'm not sure if it's actually needed. Could try removing it (and the dbus one below) and see if everything still works? The actually important variables like WAYLAND_DISPLAY are imported by the niri binary itself. |
I believe we'd still want the WAYLAND_DISPLAY and XDG_... variables to end up in D-Bus and systemd after niri is ready and before too many (or any at all) other new processes have started I had a related conversation with the COSMIC folks about this, but that solution doesn't map cleanly to the infrastructure we have here: pop-os/cosmic-session#31 |
Yeah, the niri binary takes care of that. |
Is there a way to disable activation environment management and readiness notification at runtime? For a case of external service manager? Like via a variable? Or to configure which variables are exported to activation environments? |
Uhh, not really? Not sure why you'd want to disable that. |
Also, a hint: |
So it would be handled properly by a session manager, and dependent services would not be started prematurely. |
And if it's not provided by dbus-broker? :) Some distros that run niri don't even use systemd. It's easier to have a common code path.
It's in the
But it is already properly handled and dependent services are not started prematurely.. I guess I don't really understand why uwsm is needed for niri which already provides a working systemd integration? |
It has its features, like login shell integration, idempotent environment management (including cleanup and dbus/dbus-broker issues workarounds), clean unit shutdown, various helpers, desktop entry launch wrapper, etc... Anyway, people use it and I got a bug report which appeared like a premature compositor unit readiness, but most likely it is not. If compositor exports essential variables to activation environments and signals unit readiness by itself, it is great there is no incompatibility here. The only remaining issue would be additional variables: if user tries to add more variables via Similar issue with Hyprland was resolved by a couple of environment switches (one, two) which are used on uwsm's side via a plugin. Labwc also has |
I guess it's not too big a deal to gate sd notify behind an env var, but is that really correct here? Like, my niri.service has Type=notify, which means that niri must notify its readiness. And if you're planning to use a custom service instead of niri.service, then you should already be able to set up the dependencies in such a way that niri by itself will not activate graphical-session.target, and instead for example activate a uwsm target that will add any extra variables and then activate graphical-session.target? |
There is always a possibility that a compositor can be integrated into some overarching structure like a DE or a session manager. In this case a way to hand off session/unit/environment operations would be useful.
Which allows receiving notification from child processes, that is
Triggering |
I see you're experimenting with this idea; let me know if it works out and what changes, if any, would be needed if it does. |
My experiments will at least yield a delayer for As for changes, as I said above:
So adding some kind of a switch would be nice in any case. No other changes required. |
I added I don't think suppressing env import should be that necessary? |
Thank you! |
Interesting, so disabling sd notify isn't necessary after all? |
In case of uwsm now it isn't. |
Howdie, thanks so much for sharing this project! <3
I noticed a deprecation message pop up briefly during
niri
's launch, and I tracked it down to this: systemd/systemd#18137And we call
systemctl --user import-environment
without specific variable names here:niri/resources/niri-session
Line 24 in 40cec34
The thing is, I'm not sure when this will stop working on the
systemctl
side, seeing as it's been deprecated for yearsAnd I'm not even sure what I'd recommend going forward
niri
process itself (and thus every child process it launches), just not in the user service managerAnother aspect of the current behaviour is that variables from the virtual console environment end up in my user service manager environment, like TERM=linux and PWD which are often unhelpful/confusing once I'm in a GUI desktop environment (but I can probably find workarounds for my own stuff)
Anyhow, this has probably not been super helpful, but I thought I'd log it, just in case anyone else notices the deprecation message :)
The text was updated successfully, but these errors were encountered: