0

I have a Windows Server 2003(Enterprise, SP2).

My understanding was that any process created by a user will be terminated when the user loggs off the account. But its not happening. I login via Administrator account. Start a simple java process and logoff. But the process is not killed.

Is there any configuration for this or something?

I am mostly a software programmer and not much in to servers and so I am stuck. I found out that while logging off, 1) Win32 is supposed to send a CTRL_LOGOFF_EVENT to all processes started by that user. 2) JVM is supposed to handle this event and terminate the VM.

But I can't understand why my java process is not killed when i logoff.

Any idea!!!

Ward - Trying Codidact
  • 12,899
  • 28
  • 46
  • 59
  • see if you are not passing -Xrs as a parameter to the jvm. That reduces the signals therefore ignores sighup – feniix May 03 '10 at 05:52
  • @feniix: there's no 'SIGHUP' in Windows. – Chris S Jun 16 '10 at 17:20
  • @Chris - but from a quick read, it seems like the Sun JVM does something similar on Windows if -Xrs is specified. "When the -Xrs option is used on Sun's JVM, the JVM does not install a console control handler, implying that it does not watch for or process CTRL_C_EVENT, CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, or CTRL_SHUTDOWN_EVENT. " – mfinni Jun 16 '10 at 18:19
  • could be user has a "disconnected" session still active - check the users tab in the task manager - this typically happens when a user RDP's in but does not log off (they just close the RDP window) –  May 17 '12 at 01:53

4 Answers4

1

Can you shut your process down normally w/o logging out or does it hang in that case as well? Can you instrument your code to investigate where it's getting "stuck" and whether it's getting the signal that you expect? Some of the Sysinternals process utilities link text may show what your process is doing when you expect it to terminate. Can you attach a debugger to the lingering process after you log back in again and look at what it's doing?

Fred
  • 396
  • 1
  • 1
0

i had something similar happen to me a while back (not java, however), but it turned out to be that the process i couldn't stop by logging off, was actually a service running on that server.

  • @pacey. thanks. I know that services dont stop on logoff as they are daemon in nature, but my process is a simple java process. –  Apr 22 '10 at 05:26
0

Probably the process is stuck and/or is not handling correctly the event.

See if this can help: http://www.windowsitpro.com/article/configuration/how-can-i-automatically-kill-hung-processes-when-i-logoff-.aspx

Massimo
  • 70,200
  • 57
  • 200
  • 323
  • the process is not stuck, becuase i can see the logs and everything works just fine. its doing the job what it's supposed to do. –  May 25 '10 at 10:44
0

A process will stay in memory after the system tries to terminate it if it is running some code in a driver or if another process still has an handle opened on it.
How do you check that the process is not killed ? And what is your java program doing ?

  • my process is an application server. i know process is not killed because i can still connect to the application server. And the process is simply running as normal –  May 25 '10 at 10:43