CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Location
    Washington, DC or thereabouts
    Posts
    4

    Win32 Service Child Process dies on logout.

    I've written a simple Win32 service which runs a java program via a batch file (using CreateProcess()) and waits for the java program (which is in an infinite loop) to die. The service, once started, runs until the user logs out, at which point the java process is terminated. This happens even when the service is started before the user logs in (i.e. Automatic startup type).

    I can't kill the java process using the task manager (which is the way it should be), which makes me believe it's running in the same environment as the service process itself. But does anyone know why the java process gets killed on logout? A couple of hours searching MSDN and the Knowledge Base turned up an article on running OS/2 apps from a service (from 1995 no less!), but little else.

    My current workaround for this is to have the service simply respawn the java program when it dies (unless the service is explicitly stopped by the Service Control Manager), but I would like to have a more elegant solution.

    Any suggestions or wild theories would be appreciated.

  2. #2
    Join Date
    Jan 2001
    Posts
    588
    I don't really have any good solutions for you, but you may want to try this question over in the Visual C++ forum. It's more geared toward Windows development, so you may get more help there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured