-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
code cannot start with AFS homedir #22593
Comments
Squinting at the XDG Base Directory Specification it seems like sockets and other runtime files shall be created in |
Not sure what to do here. Best I can do is to recommend not using AFS. Does it support socket files? |
I don't have any choice in AFS for my home directory where the default XDG config directory is located. Sure I could point the config elsewhere, but then I'd lose access to the same configuration across machines which is the whole point of a shared homedir. AFS doesn't support named pipes in the filesystem intentionally as it's a distributed filesystem and the semantics for how they would work across the world is hard to pin down. As far as I interpret the XDG specification, you should not use the config directory for runtime state. They explicitly mention the runtime dir for that.
|
Got it, thanks. |
the same thing for the socket files in /tmp/ like /tmp/vscode-9106d11a-a2f2-4ba7-8e8c-269c06c6710f.sock= they should go in $XDG_RUNTIME_DIR (if available, if not /tmp is ok). the added benefit of $XDG_RUNTIME_DIR is it goes away when the user logs out. |
The same issue appears with sshfs mounted home directory |
We were force to undo this change since it breaks many assumptions at startup, when this variable may or may not be set. Unfortunately, the correct workaround for these cases is to call code with |
Hi! Now 1.17. stopped working on AFS @joaomoreno. Not sure if the workaround you gave makes sense, as the $XDG_RUNTIME_DIR directory gets deleted every time the user restarts. I would be happy if you could fix that. Thanks! |
Does the workaround work for you at all? |
Thanks for the fast reply. It does work for one session, but settings for example get deleted when I reboot. |
Why is that? I don't really know AFS. |
Me neither, but what I think right now: The XDG_RUNTIME_DIR variable gives something like But the problem ia not the user data, it is the .sock file that has trouble with AFS. So it is just this file that needs to be stored somewhere else in a non AFS directory. |
Currently the |
Yeah, for example. I don’t know what the .sock file does, but if it is not a problem that it is removed after reboot that might be an option. But isn’t that what the pull request #28816 did? Just storing the .sock file somewhere else... |
Yes, #28816 did exactly that, but based on an env variable, which is very problematic in many cases. So, I propose to introduce a cli option to set the socket files location on Linux. So you'd need to launch it as:
Would that work for you? |
Cool, I would expect that to work for me. Thanks! Let me know if you want me to test. |
problematic in what cases? the XDG recommendations are pretty clear and easy to follow. You have a DATA dir, CONFIG dir and RUNTIME dir. There are environment variables to specify the directories or there are defaults when the env vars are not there. What doesn't work in vscode with that setup? |
Let's talk Linux only. It makes a big difference in terms of process environment if you open an application from within a shell or using a UI gesture. The shell usually has all you favourite environments, often set up in So: on startup, and only if Code wasn't launched in a shell, Code will try to infere the user's shell environment as best as it can. This is possibly a lengthy process (have you ever waited 1-2 seconds until you see that There's a race condition here. You see, we need to know the exact location of the IPC sockets at startup, before any window opens. If For the past few months we were relying on reading One alternative for a fix is to ignore the |
XDG_RUNTIME_DIR is typically set by pam_systemd, even before their Desktop Envrionment or login shell is started.
So in conclusion I have not heard of anyone redefining XDG_RUNTIME_DIR for interactive shells only, but if they do that, that's the users mistake to break things intentionally. |
Alright, then let's do that: we'll simply ignore it when reading it after startup. |
Steps to Reproduce:
.config
on AFS.code --verbose
.Code starts normally if moving the
.config/Code
directory to a local filesystem and symlinking it in. I would reckon that it's probably not portable to put the kind of thing that1.10.2-main.sock
is in the homedir, as it may very well be mounted in fun ways or on network filesystems.This behaviour is new since the previous release I ran, which I believe was
code_1.9.1-1486597190_amd64.deb
.The text was updated successfully, but these errors were encountered: