How to avoid Citrix Workspace overstaying their welcome on Ubuntu

Citrix Workspace for Ubuntu ships as a hefty .deb file (currently at 431 MB). Even if you say no to all its optional components (deviceTRUST etc.), there still is quite some bloat left.

If you’re in a hurry, I (not entirely myself) made a shell script to do all the steps below. It makes some Debian / Ubuntu assumption!

curl https://bartbroere.eu/downloads/citrix_cleanup.sh | bash

The first thing that can be disabled is ctxcwalogd, a Citrix log writer service that wants to run permanently:

sudo systemctl disable ctxcwalogd
sudo service ctxcwalogd stop

If you have a running Citrix Workspace connection you’ll probably have these binaries running:

After you close the connection the first two will disappear, but the last one (icasessionmgr) will keep running. That’s not necessary as far as I’m concerned, and I don’t believe there’s a way to configure Citrix Workspace not to do that. To fix it I replaced the wfica binary with a wrapper script that cleans up after it:

# first move the original binary to a new location
sudo mv /opt/Citrix/ICAClient/wfica /opt/Citrix/ICAClient/wfica_

Now create the file /opt/Citrix/ICAClient/wfica and have it contain something like this:

#!/usr/bin/env bash                                                                                                                                                                                   
/opt/Citrix/ICAClient/wfica_ "$@"
pkill -f icasessionmgr

Make it executable:

sudo chmod +x /opt/Citrix/ICAClient/wfica

This wraps the wfica binary and makes it clean up the icasessionmgr after it’s done. The changes you have to make may be different if you don’t use the wfica part of Citrix Workspace, but something like the CEB (Citrix Enterprise Browser).

Of course these two changes are nothing special, but they make Citrix behave a bit better on your system. If you discover other ways Citrix sticks around, feel free to let me know!