Git Product home page Git Product logo

Comments (5)

sareyko avatar sareyko commented on June 27, 2024

So I just did a quick test and did some reading on systemd.

For me changing the PartOf of the bind mount units to default.target or removing it alltogether seems to work just fine. On login the services get started and when I close the last user session they get stopped and the bind mounts get unmounted. This works no matter what way I login (graphical, console or remote).

Since I don't quite understand why PartOf=graphical-session-pre.target is there in the first place I have to ask what the intention of that is? Is this needed to make some part of Home Manager (switching) work correctly?

from impermanence.

talyz avatar talyz commented on June 27, 2024

The reasoning behind PartOf=graphical-session-pre.target is to have them start as early as possible and before the rest of the graphical user session is started. The user could, for example, have autostart programs which rely on directories being bind mounted. On my installations, which don't use the home-manager xsession, this works fine. I don't really see a reason why the graphical-session-pre.target should be stopped when the session has started; in fact it seems to contradict the upstream description of its use.

@rycee Do you know if there's a reason graphical-session-pre.target is stopped here?

from impermanence.

sareyko avatar sareyko commented on June 27, 2024

From what I understand making the unit PartOf=graphical-session-pre.target is not the correct way of achieving that behavior since PartOf only affects the unit when the given units are stopped or restarted.

Here's what systemd.unit(5) has to say:

PartOf=
Configures dependencies similar to Requires=, but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency — changes to this unit do not affect the listed units.

Also I don't feel like impermanence should depend on a graphical-session at all.
On the other hand I don't see any targets in the various systemd manpages that we could attach to to make sure the bind mount units get started before any other units that might depend on the mounts being present already.
I'm running impermanence with the bind mount units just WantedBy=default.target for a week now without any issues though.

from impermanence.

talyz avatar talyz commented on June 27, 2024

Oh, right, I got it confused with Requires - they currently start because WantedBy=default.target gets added by default. The correct option would probably be WantedBy=graphical-session-pre.target, though.

from impermanence.

talyz avatar talyz commented on June 27, 2024

Um, wait, no Install.WantedBy = [ "default.target" ] is in the definition of the unit, so never mind. As it's been working fine so far I guess we could just remove the PartOf and keep the WantedBy as is for now; that way it won't depend on a graphical session either.

from impermanence.

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.