Under review

How to restart Session Manager?

adam.connor 1 year ago updated 11 months ago 9

Is there a way to restart the session manager in on-prem linux that does not involve rebooting the server?

This is driving me nuts

*yes I'm aware that this sounds very much like a Microsoft joke-
What's the biggest problem with our software? 
It crashes too much
Microsoft Engineer 'we fixed it, we made it reboot faster'

On CentOS, I just run:

$ service screenconnect restart

It takes quite awhile but it does come back to life (usually). I'm running 20.2 release. It's still quite buggy. Leaving it around for any left behind systems that don't get turned on frequently to see the reinstall command, to point to the Windows server that I setup a few months ago.

Does anyone know a workaround to make this happen automatically? We need a script that automatically checks the session manager whether it is still working. And if it freezes, the service would have to be restarted automatically.

That doesn't solve the fundamental problem that this company isn't doing its job and simply fixing the bug. But after months of waiting and restarting every day, I am happy about every possibility of simplification.

on Ubuntu this is 

sudo systemctl restart screenconnect

Guessing you could add a cron job for this, may investigate later. Good idea to monitor the Session Manager service

I had a cron job before to restart at 2 a.m.

But it crashes during the day regardless of whether I restarted the service at night or not. So it needs a more intelligent script with an active trigger. 

I tried probing localhost port 8042 because my service was running with no errors, but the session manger on port 8042 stops working.  This did not help because that port is still "open" but the session manager isn't fully "responding" thus ScreenConnect 20.2.29488.7513 for linux is not really working at all and the whole service must be restarted,  I might have to check for a certain file activity as an alternate check.  Is there any file that uniquely can tell me that the session manager is fully functional without any users actually using the system?  There are many "access" client system always connected.  Time scheduled restarts is no good I agree, must be a valid outage test.  Open to any other ideas?

I lost track of what version this problem started on, but every time I update, I say a small prayer that I can return to the days of not needing to flip a coin whether the session manager will be up or not. On my installation the session manager will typically just start working as normal again after a variable amount of time, but that's definitely not a solution.

ever consider:

crontab -l

0 0 * * * killall mono

(kill mono everyday at midnight) ?    I tested this manually and it restarts, it actually restarts much quicker then the entire screenconnect service.  


It's good to restart screenconnect faster, but the primary problem is that I cannot schedule a time for service restarts because the session manager can hang and freeze numerous random times throughout any given day and I was looking for some way to detect that scenario and only restart if it is frozen.  For example:  Only the "admin" section of the web gui shows up but not "support", "meeting" or "access". I was going to try and use wget or curl along with grep and a script to detect their absence and then initiate a service restart but have not yet invested the time to get that far, only real browsers get the full html and js response, already tried PhantomJs and no difference, still investigating.


yes we already know that CWC can tell if the session manager is running- it's in the Admin panel. Running that detect script and firing a restart of the service is a good idea. Also doesn't fix the problem, but it would be a good start...