XDG_RUNTIME_DIR: When is a user logged out?
thomas at kluyver.me.uk
Thu May 10 08:38:46 UTC 2018
The basedir spec says of XDG_RUNTIME_DIR:
> ...if the user fully logs out the directory MUST be removed.
What counts as logging out? For some application code, I assumed that if the application was running as user X, that meant user X was still logged in, and the application could rely on XDG_RUNTIME_DIR continuing to exist. However, some users have reported that if they run a process in nohup/screen and then disconnect, their XDG_RUNTIME_DIR is deleted because they have logged out. It looks like other people have had similar issues:
I tested this on a Debian system and I couldn't reproduce the problem: XDG_RUNTIME_DIR continued to exist when I disconnected and left a script running in nohup. But I don't know what to tell users who are experiencing this issue.
1. When should the user count as logged out? Is my assumption that the user is logged in while any process is running with their UID reasonable? Can we clarify this in the spec?
2. If my assumption is how it's meant to work, what component is getting it wrong? Is this the SSH server's job? Are there any known issues about it?
More information about the xdg