Dug a little deeper. I compiled and installed KStars from source in order to get more detailed debug info. It seemed odd to me that it wanted to disconnect from the server after removal of the driver so as a temporary workaround I just commented out a couple of lines in EkosManager::cleanDevices() and it seems to work better. Not sure what else this breaks but at least it does not hang any more. Here's the modified function:

void EkosManager::cleanDevices(bool stopDrivers)
{
    if (ekosStartingStatus == EKOS_STATUS_IDLE)
        return;

    INDIListener::Instance()->disconnect(this);
    DriverManager::Instance()->disconnect(this);

    if (managedDrivers.isEmpty() == false)
    {
        if (localMode)
        {
            if (stopDrivers)
                DriverManager::Instance()->stopDevices(managedDrivers);
        }
        else
        {
            // TEMPORARILY COMMENTED THESE TWO LINES OUT
            // if (stopDrivers)
            //     DriverManager::Instance()->disconnectRemoteHost(managedDrivers.first());

            if (remoteManagerStart && currentProfile->INDIWebManagerPort != -1)
            {
                INDI::WebManager::stopProfile(currentProfile);
                remoteManagerStart = false;
            }
        }
    }

    reset();

    profileGroup->setEnabled(true);

    appendLogText(i18n("INDI services stopped."));
}


Read More...