Giter Club home page Giter Club logo

Comments (7)

Thaodan avatar Thaodan commented on June 24, 2024

Oh I see you are already using, is there a reason that editing the service is still needed?

from localdir.

Thaodan avatar Thaodan commented on June 24, 2024

I noticed that in some places you set vars manually or parse environment.d you can just call:
export $(run-parts /usr/lib/systemd/user-environment-generators | xargs)

Instead.

from localdir.

ayekat avatar ayekat commented on June 24, 2024

Hi, thanks for your interest in this repo! :-)

The PAM approach no longer works due to pam_env.so having deprecated the user_readenv option (discussions in linux-pam#7), hence my switch to something that does not involve PAM in cea0a05.

However, in that commit I also noticed that merely using environment.d does not work entirely as intended, because the systemd user instance itself does not adopt the variables. So while all user units adopt the new envvars, systemd itself reads its units from ~/.config/systemd, replaces %E in unit files by ~/.config, etc.

The way I see it, there is currently no way of solving the bootstrapping issue purely on a user level, hence my workaround solution of extending my user's [email protected] where possible, or simply give up and let systemd create a mess in my homedir.


On using the provided environment generators rather than parsing the variable files manually, that does seem more elegant indeed, thanks for the suggestion! :-)
I'll see if I can implement this sometime soon.

from localdir.

Thaodan avatar Thaodan commented on June 24, 2024

from localdir.

ayekat avatar ayekat commented on June 24, 2024

Improved environment generation in 5460772 (no more manual parsing). Not doing it with run-parts, because I cannot assume that to be universally available.


If you set the variables early enough than it picks them up.

Unfortunately, the "early enough" is "before the user unit starts", so it's either extending the user unit itself or setting the variables at PAM level (e.g. /etc/environment, which is ugly).

Ideally, [email protected] would allow the user to provide an environment file somewhere in it's home (I'd probably go with ~/.environment) that it sources with EnvironmentFile=-…, but I could not find a way to determine the user name from within the unit file. 🙁

from localdir.

Thaodan avatar Thaodan commented on June 24, 2024

Improved environment generation in 5460772 (no more manual parsing). Not doing it with run-parts, because I cannot assume that to be universally available.

I used xargs -0, didn't use eval but that seems to work too.

If you set the variables early enough than it picks them up.

Unfortunately, the "early enough" is "before the user unit starts", so it's either extending the user unit itself or setting the variables at PAM level (e.g. /etc/environment, which is ugly).

Ideally, [email protected] would allow the user to provide an environment file somewhere in it's home (I'd probably go with ~/.environment) that it sources with EnvironmentFile=-…, but I could not find a way to determine the user name from within the unit file. slightly_frowning_face

Yeah that is what I couldn't avoid too. But anything outside of /etc is chicken and e.g. issue.

from localdir.

ayekat avatar ayekat commented on June 24, 2024

Turned out my solution was a bit bugged (only found out later upon restarting my session), so had to adapt the variable exporting a little more with 1e25dd7, but it now works for me.

Going to close this for now, thanks for your input!

from localdir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.