Cleaning FastX directories

Occasionally old session data will linger around in certain directories when using FastX. These data files should be cleaned out periodically to reduce the amount of disk space on the server as well as removing unused sockets.

Files are found (by default) in /tmp and the user’s $HOME/.fastx_server/$HOSTNAME/ directories
It is important that you do not delete files of currently running sessions. Otherwise you will not be able to communicate with the session anymore

FastX Files

FastX uses several files in order to communicate. The following is a listing of files and default locations FastX uses to operate

  • Communication Sockets: /tmp/Xrdp_*.sock
  • Display numbers: /tmp/.X11-unix/X*
  • User’s FastX directory: $HOME/.fastx_server
  • FastX Certificate: $HOME/.fastx_server/server_cert
  • FastX Private Key: $HOME/.fastx_server/server_key
  • User’s Server directory: $HOME/.fastx_server/$HOSTNAME
  • User’s Sessions directory: $HOME/.fastx_server/$HOSTNAME/sessions
  • User’s Specific Sessions: $HOME/.fastx_server/$HOSTNAME/sessions/C-*

Resetting the server

After an upgrade, the FastX server should be reset

Kill the process: fastx_server

Optionally, you can delete the user’s server_cert and server_key files.
These files will be recreated during the next log in. This is occasionally necessary after an ssl library upgrade

Cleaning Out Old Sockets

The following command will get a list of all currently running X11 sockets used by FastX. DO NOT DELETE SOCKETS IN THIS LIST

ps h -C Xrdp -o args | awk '{sub(":","/tmp/X",$2); print $2}'

Unix sockets are stored in /tmp/.X11-unix

You can delete sockets starting from X100 that are not in the list of running sockets

Cleaning out old directories

The following command will get directories that are currently being used by a fastx process. DO NOT DELETE THESE DIRECTORIES

ps h -C Xrdp -o args | awk '{gsub(":","",$2); print $2}' | while read line
do
grep -e $line $HOME/.fastx_server/$HOSTNAME/sessions/*/display | sed s/display.*//
done;