diff options
-rw-r--r-- | Command/Assistant.hs | 6 | ||||
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | doc/bugs/kill_git-annex_assistant_on_logout.mdwn | 26 |
3 files changed, 35 insertions, 0 deletions
diff --git a/Command/Assistant.hs b/Command/Assistant.hs index 97bc08c7b..8a916aa55 100644 --- a/Command/Assistant.hs +++ b/Command/Assistant.hs @@ -91,6 +91,12 @@ autoStart startdelay = do where go haveionice program dir = do setCurrentDirectory dir + -- First stop any old daemon running in this directory, which + -- might be a leftover from an old login session. Such a + -- leftover might be left in an environment where it is + -- unavble to use the ssh agent or other login session + -- resources. + void $ boolSystem program [Param "assistant", Param "--stop"] if haveionice then boolSystem "ionice" (Param "-c3" : Param program : baseparams) else boolSystem program baseparams diff --git a/debian/changelog b/debian/changelog index 80bf514ad..a91b8498b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ git-annex (5.20150618) UNRELEASED; urgency=medium * log: Fix reversion introduced in version 5.20150528 that broke this command. + * assistant --autostart: First any daemons that are already running, + which might be left over from a previous login session and so unable to + use the ssh agent of a new login session. -- Joey Hess <id@joeyh.name> Thu, 02 Jul 2015 12:31:14 -0400 diff --git a/doc/bugs/kill_git-annex_assistant_on_logout.mdwn b/doc/bugs/kill_git-annex_assistant_on_logout.mdwn index 0640a5aaf..7c3a5affc 100644 --- a/doc/bugs/kill_git-annex_assistant_on_logout.mdwn +++ b/doc/bugs/kill_git-annex_assistant_on_logout.mdwn @@ -1,3 +1,29 @@ When you logout of any x session git-annex does not get killed. This means that if you login again git-annex will still try to use the ssh-agent from the last session which doesn't run anymore. This leads to countless password queries unless you use a passwordless key. + +> I've fixed this, though maybe not in an ideal way. +> +> There's no way to make a XDG desktop file run a command on logout, that I +> can see. That would have been my first choice. +> +> So, I thought I'd just have the assistant not run setsid, so it's part of +> the current login session and would get killed automatically on logout. +> I was surprised that this didn't seem to work, on a system using logind. +> Even when the desktop file ran git-annex with --foreground, it was not +> stopped on logout. This may be because logind defaults to +> KillUserProcesses=false, +> although I'm not sure why processes that are part of the login session +> are not killed at least. +> +> What I have settled on is to leave the daemon running after logout, +> but on a new login have the `git annex assistant --autostart` kill the +> old daemon and start a new one. +> +> Only possible problem with that is there will be a small window after +> login where the old daemon is running. It might slip in a password prompt +> there, using the new DISPLAY. At least it won't flood, and even a single +> password prompt is pretty unlikely. +> +> I am tenatively going to call this [[done]]. Seems to me that logind +> could be improved though. --[[Joey]] |