Re: Default connection timeout for the sudo method
Michael Albinus <[email protected]> Fri, 15 Aug 2025 09:19:12 +0200
| Newsgroups | gmane.emacs.tramp |
|---|---|
| Message-ID | <[email protected]> |
"R. Diez" <[email protected]> writes: > Hi all: Hi, > About the problem I described here: > > https://lists.gnu.org/archive/html/help-gnu-emacs/2025-08/msg00061.html > > I suspect that the problem may be triggered by Tramp's session timeout, as I am seeing this message in the *Messages* window: > > Tramp: Timeout session /sudo:root@hostname: > > I fear that, after the session times out, Tramp gets confused about the previous lock file upon reconnection, and gets confused with the temporary file when saving, so that it leaves one of them behind. Good catch! I'll see what I can do. One idea is, that a session timeout is suppressed as long as there are modified buffers visiting a respective remote file. > I found something about such timeouts in the manual here: > > https://www.gnu.org/software/emacs/manual/html_node/tramp/Predefined-connection-information.html > > The key is: > > "Most of the methods do not set this property except the sudo, doas and run0 methods, which use predefined values." > > The trouble is, the manual does not say what the predefined value for such connections are. The default value is 300 seconds. You're right, the manual shall mention it. > Is there a way to change that predefined value for such connections? The link you have shown above is about connection proiperties. You can change "session-timeout" liike shown in the example: (add-to-list 'tramp-connection-properties (list (regexp-quote "/sudo:") "session-timeout" nil)) disables this. > If you edit a file, but do not save it, I am not sure that it is such a good idea for Tramp to let the connection timeout, especially if a lock file has been created. Indeed, see my comment above. > Thanks in advance, > rdiez Best regards, Michael.