Session Check

Started by edjack, August 08, 2019, 01:47:42 PM

Previous topic - Next topic


I there a way to check that a pvxplus session is active and if not launch it.
Maybe a background pvx program running continuously or a 3rd party app??
Ed Jack

Ben Alexander

I was about to ask the same question.  My old methods are not working now.

Mike King

There isn't really a direct way to to this.

On Windows you could set your Caption to some specific value and then in the other programs use FindWindowA to search for that caption, but that's a Windows only solution.

What I would suggest is to simply create a generic control file and have the processes that you want to check on simply lock/extract specific records.  If you want to see if the process is running just try to access the associated record and if that request fails then the process is running.  Also, should a process die (gracefully or not) the lock will be cleared.

This approach also has the advantage that the control file could in fact be accessed remotely using mapped/mounted drives.
Mike King
President - BBSysco Consulting

Ben Alexander

I am trying to get an rpc server session running in the background but when I disconnect from the system it dies. Using a crontab entry comes to mind but I do not know what to look for in the ps -ale.