Skip to content

devel The socketdir directory

matt335672 edited this page Jul 21, 2025 · 2 revisions

Introduction

Scope

This page applies to the development version of xrdp.

Description

The socketdir contains file sockets used to link user session components together.

At compile time, the directive --with-socketdir= can be used to set the socketdir to a suitable location for the system.

Contents and permissions

The directory is owned by root:root with permissions of 755.

The xrdp-sesman daemon manages all top-level contents of the directory.

At the time of writing, the following entities can be found in this directory.

The symbol $UID means a numeric user-ID and the symbol $SockdirGroup is the setting of SessionSockdirGroup within sesman.ini.

File Permissions Owner:group More info
sesman.socket 666 root:root Used to contact sesman
sesman.socket.r/ 700 root:root Recovery directory for sesman.socket
.sesman.socket.lock 600 root:root Lock file for sesman.socket
<uid> 2750 $uid:$SockdirGroup Per-user session sockets (one per user)

The recovery directory contains sockets created by sesexec processes which allow a restarted sesman to discover existing user sessions.

The setgid bit is set on the per-user directories. This allows the sockets created within these directories to have a group ownership of $SockdirGroup rather than the primary group of the user - see #3011 for details.

For this version of xrdp, $SockdirGroup is normally set to root. xrdp acquires access to per-user session sockets by asking sesman to connect to the sockets on its behalf.

Where sesman is not used to manage sessions, the value of $SockdirGroup can be set to the runtime group of the xrdp process. This allows the xrdp process to access these directories directly.

Within each of the per-user directories, the following socket files can be found.

Sockets are owned by $uid:$SockdirGroup with a permissions mask of 660.

File Created by? Used by? More info
xrdpapi_$DISPLAY chansrv session applications see below
xrdp_chansrv_socket_$DISPLAY chansrv XRDP process see below
xrdp_chansrv_audio_in_socket_$DISPLAY chansrv session pulseaudio/pipewire server see below
xrdp_chansrv_audio_out_socket_$DISPLAY chansrv session pulseaudio/pipewire server see below
xrdp_display_$DISPLAY xorgxrdp module XRDP process see below
xrdp_disconnect_display_$DISPLAY xorgxrdp module session applications see below

An up-to-date list can be found in the source file common/xrdp_sockets.h.

xrdpapi_$DISPLAY

Socket used for communicating with chansrv by libxrdpapi applications (e.g. vrplayer)

xrdp_chansrv_socket_$DISPLAY

This socket is connected to by the XRDP process (xrdp(8)). It carries virtual channel data between XRDP and chansrv.

This socket is only present in the file system while chansrv is awaiting a connection from xrdp(8). The listening socket is removed when xrdp(8) connects to prevent concurrent connections to chansrv. It is re-created when the connection to xrdp(8) is closed.

xrdp_chansrv_audio_*

These sockets are connected to by the pulseaudio server in the user's session. See the pulseaudio-module-xrdp wiki for more information on this facility.

xrdp_display_$DISPLAY

This socket is only present for Xorg-based sessions. This socket is connected to by the XRDP process. It carries RDP data between XRDP and the X server.

xrdp_disconnect_display_$DISPLAY

This socket is only present for Xorg-based sessions. This socket can be used to disconnect a session. It is used by xrdp-dis(1).

Clone this wiki locally