ralphlange / procServ

Wrapper to start arbitrary interactive commands in the background, with telnet or Unix domain socket access to stdin/stdout
GNU General Public License v3.0
23 stars 23 forks source link

FIX: call the hideWindow() method as long as the process is running. #10

Closed apanna closed 8 years ago

apanna commented 8 years ago

On windows, with procserv compiled under cygwin, if an ioc is started using procserv an empty cmd window (see below) stays in the foreground and on closing the cmd window, procserv is terminated. The commit fixes this issue. Here's the command that I used to run the ioc with procserv:

@echo off
rem incase we do dynamic builds
if exist "dllPath.bat" (
    call dllPath.bat
)
if exist "C:\Epics\extensions\bin\%EPICS_HOST_ARCH%\procServ.exe" (
    procServ --allow -n "SIM-DETECTOR" -p pid.txt -L log.txt --logstamp -q -i ^D^C 3002 ..\..\bin\%EPICS_HOST_ARCH%\simDetectorApp.exe st.cmd
) else (
    ..\..\bin\%EPICS_HOST_ARCH%\simDetectorApp.exe st.cmd
)

procserv_emptycmd

ralphlange commented 8 years ago

Thanks for the suggestion. I have asked Freddie Akeroyd (who provided the original fix) for his opinion.

FreddieAkeroyd commented 8 years ago

Hi Alireza,

I had forgotten I had added some code to our EPICS base that hid this extra IOC window, it is indeed present without it. Unfortunately adding the hideWindow() to the connection loop also hides the windows I use to launch procServ, but moving the hideWindow() to inside processClass::processClass() in processFactory.cc around line 212 (after the setsid() but before execvp()) works well for me, does it work in your case too?

Regards,

Freddie

apanna commented 8 years ago

Hi Freddie,

Yes! moving the hideWindow() call to processFactory.cc inside the processClass constructor works for me as well.

Best, Ali

On Wed, Aug 31, 2016 at 11:50 AM, Freddie Akeroyd notifications@github.com wrote:

Hi Alireza,

I had forgotten I had added some code to our EPICS base that hid this extra IOC window, it is indeed present without it. Unfortunately adding the hideWindow() to the connection loop also hides the windows I use to launch procServ, but moving the hideWindow() to inside processClass::processClass() in processFactory.cc around line 212 (after the setsid() but before execvp()) works well for me, does it work in your case too?

Regards,

Freddie

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ralphlange/procServ/pull/10#issuecomment-243808865, or mute the thread https://github.com/notifications/unsubscribe-auth/AGkgAu_BcMHC-NnF6Ob_S7VvrwADeUAsks5qlaLGgaJpZM4JuoKW .