Comments (5)
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.
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.
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.
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.
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)
- Regression after using escapeSystemdPath HOT 3
- `user.*.directories` assertion is displaying incorrectly`
- Issues with bindfs: no entry in /etc/mtab HOT 1
- Persisting Steam breaks any game within it and also fails shutdown HOT 4
- Boot does not revoke chmod permissions HOT 1
- [REQUEST] Declare `something.impermanence.enable` option for integration with other modules and easy way to disable impermanence HOT 1
- Handle bind mount of directory that already has content HOT 2
- `nixos-rebuild` fails due to the symlink, Impermanence created
- Best practice to split configuration HOT 1
- missing `x-gvfs-hidein` in mount
- Strategies to deal with `renameat(3)` on persisted files HOT 1
- Infinite recursion error when persisting anything in /var/ HOT 1
- Symlinks created via the home-manager module are broken HOT 1
- The importance of persisting `/var/lib/nixos` is not documented HOT 2
- Cannot use `users.users` without infinite recursion
- Empty list for home.persistence directories does not build HOT 3
- home-manager module cannot mount files to /persist. permission denied. HOT 1
- Root cannot access directories persisted with home-manager HOT 1
- Opt-in Mirror Mode
- Impermanence issues with SSH when provisioning with nixos-anywhere + disko + flakes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from impermanence.