-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add restartability to sesman #3346
Open
matt335672
wants to merge
19
commits into
neutrinolabs:devel
Choose a base branch
from
matt335672:restart_sesman
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matt335672
force-pushed
the
restart_sesman
branch
from
December 17, 2024 12:02
45c66c8
to
dfadda4
Compare
This is not year 2038 compliant on systems with 32-bit integers. The call can be replaced with the standard C time() call. On POSIX systems, time_t is guaranteed to be an integer type.
This is currently unused in xrdp
The function as specified used gettimeofday() which is susceptible to manual time changes, and is obsoleted in POSIX.1-2008. The replacement uses clock_gettime(CLOCK_MONOTONIC, ) which is not susceptible to manual time changes (at least on Linux) and cannot run backwards. Also, on systems with 32-bit integers, the value returned by this function wraps around every 49.7 days. To cope with a wraparound in a way compliant with the C standard, this value needs to return an unsigned integer type rather than a signed integer type.
This function does not need to have global scope.
The function sesexce_scp_data_in in sesexec.c is a development artefact and can safely be removed
This is used by sesman to connect to sockets in the restart directory.
Adds a module which can be used when sesman is restarting. This is initially used to rediscover sessions from a previous run.
Also add useful comment to session_send_term()
The module is a dummy to be filled in later Other structural changes to sesexec:- 1) A failure of sesman needs to be detected and handled without causing sesexec to exit 2) If sesexec exits, the session can never be rediscovered. sesexec must be robust enough to stay up for the lifetime of the session so that the discovery function always works. 3) There is a mechanism for sesexec to terminate the session, but it doesn't work, as SIGCHLD is not processed while we are waiting for the session to finish. This needs fixing.
These sesexec functions are needed for the discovery module to function.
Add functionality to sesexec discovery module to enable sesman restarts.
matt335672
force-pushed
the
restart_sesman
branch
from
December 17, 2024 20:40
dfadda4
to
f18bebd
Compare
matt335672
force-pushed
the
restart_sesman
branch
from
December 18, 2024 12:58
bfa34f4
to
63c2e18
Compare
The KillMode of process allows an xrdp connection to survive a reatart of the xrdp process. This is of minimal benefit, as a user can always simply reconnect - the session will survive the restart. The downside is that xrdp will not benefit from any security fixes, and may well end up out-of-sync with sesman.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is now ready for review.
Fixes #800
Depends on #3328
See also #819
This PR allows for sesman to be restarted without losing sessions.
A restart of xrdp will still drop connections, but these can easily be restarted.
In brief, the design is this (I can add more details around this):-