PKGBUILD script to convert a ConnectWise Control deb file to an Arch linux package
WaylandEnable=false
git clone https://github.com/Kelderek/connectwisecontrol-arch
)makepkg -si
That will install the control agent, its dependencies, and setup a systemd service set to autostart./opt/connectwisecontol-{yourServerId}/reset-displays.sh
. Do not run it as root or with sudo! It will prompt for credentials when needed, but it needs to start the agent as a regular logged in user. Further discussion on this is in the notes below.The agent seems to have trouble detecting the X session and connecting to it on a modern system. Some of that I was able to mitigate with the dependencies I added, but it still has trouble. Fixing that is beyond my control - ConnectWise will have to do it. In the meantime I added the reset-displays.sh script, which temporarily runs the agent as the user instead of the system so it can find the correct X11 display(s). Unfortunately, when the agent restarts as system the regular join method can't see those options anymore, but luckily the are still cached in the server's session manager service, so you can use Join with Options as described in the installation instructions above to tell it what display server you need.
The problem is those cached optinos will get lost periodically, for example whenever the session manager service is restarted on the ConnectWise Control server. The specific session you need to pick may also change based on something happening on the system like an Xorg update, or possibly adding/removing monitors. If something like that happens, you can run the reset-displays.sh script again and it should pick up the changes. It isn't an elegant solution, but it is the best I could do; ConnectWise are the only ones who can really fix it.
The agent will connect before logon, but will not display the logon screen. As far as I can tell, this is a limitation of ConnectWise Control for Linux systems as it works that way on Ubuntu and Fedora as well. You are still able to issue commands to the agent through the ConnectWise Control website and once the system is logged in it will be able to connect the video.
The folder and service names use the connectwisecontrol-{connectwiseid} format so it shouldn't conflict with multiple ConnectWise Control installs. Most people won't need multiple agents installed on the same system, but if you need that you will need to modify the pkgname field in PKGBUILD file in order to use this package multiple times. The install folder, service, etc. will all follow what is in the deb file.
Uninstalling from the ConnectWise website doesn't work, you will need to run pacman -Rs connectwisecontrol
1) The package name itself is just connectwisecontrol instead of the deb package's name of connectwisecontrol-{connectwiseid} 2) The deb package's postinst script is added to the connectwise files in /opt so it is available for pkgbuild to run post install 3) The initrd script is given an initrd extension and moved to the connectwise files in the /opt folder for use starting and stopping the service 4) Added the reset-displays.sh script and connectwisecontrol-{connectwiseid}.service systemd unit file 5) I didn't install the /usr/share/lintian/overrides/connectwisecontrol-{connectwiseid} because Lintian is a Debian package checker and therefore not relevant in this case