The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
Google UNIX.COM


Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cronjob dies when user password expires sparcguy SUN Solaris 4 02-04-2007 11:04 PM
script to change default route when primary gateway dies slacker Shell Programming and Scripting 0 05-24-2006 09:34 AM
xdmcp dies in sco600 khafner SCO 0 04-23-2006 04:02 PM
daemon dies, need to know why Silver11 SUN Solaris 2 03-24-2006 02:26 PM
email notification if job is killed/dies jacob_gs Shell Programming and Scripting 2 05-15-2002 11:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-05-2006
Registered User
 

Join Date: Dec 2006
Location: dallas tx
Posts: 42
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
How to detect if a Windows app dies??

Hello All: I hope this is the right category…
I have a application (this app runs under java and jboss) that runs under Windows, it’s started as a service. If that application should become disabled, crash or no longer function, what would be the best method for determining it is no longer running? If this was UNIX it would be a no-brainer I could simply watch for the pid or write a script to tickle the app. I don’t think I have that luxury on Windows (Sever 2003,2000, XP)

Again Thanks all
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-05-2006
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,439
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Actually, believe it or not you do have pid, but I have no great experience of windows, but I would expect that there is something in the APIs to get PIDs. My main concern would be ( from the last time I had to work with windows ) is that is is very difficult to get that kind of information after the fact if the process does not itself open a window.
Reply With Quote
  #3 (permalink)  
Old 12-06-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,628
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by jimmyc
I have a application (this app runs under java and jboss) that runs under Windows, it’s started as a service. If that application should become disabled, crash or no longer function, what would be the best method for determining it is no longer running?
You mention services. You can use net start to see if your service is currently up or not.
Reply With Quote
  #4 (permalink)  
Old 12-06-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,628
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by reborg
My main concern would be ( from the last time I had to work with windows ) is that is is very difficult to get that kind of information after the fact if the process does not itself open a window.
Difficult - yes.
Very difficult - probably.

If you want to go down this way, you should look at the toolhelp32 api or use the psapi library. There are a couple of other ways as well. See Alex Fedotov's write up on the same.

Last edited by vino; 12-06-2006 at 07:03 AM.
Reply With Quote
  #5 (permalink)  
Old 12-07-2006
Registered User
 

Join Date: Dec 2006
Location: dallas tx
Posts: 42
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Thanks All: Our customer has asked for this request but it doesn't seem to be a "hot" topic for them. I'll go down that road if it becomes more of a issue. One thing I might be able to do,... Our application opens tcpip ports. I could poll that port ever 15 minutes if its gone then I might have a pretty good idea our app is toast. A netstat -a and search for our IP port "should" be pretty simple. I'll look into "net start" and see what that offers.

Hay... this is a GREAT site Keep up the good work !!!!
Reply With Quote
  #6 (permalink)  
Old 12-07-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 923
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by jimmyc
Our application opens tcpip ports. I could poll that port ever 15 minutes if its gone then I might have a pretty good idea our app is toast.
Could you make a persistent connection, and wait for it to close?
Reply With Quote
  #7 (permalink)  
Old 12-07-2006
Registered User
 

Join Date: Dec 2006
Location: dallas tx
Posts: 42
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Hmm.. Good suggestion I'll have to think about that. Meanwhile.. I was looking at net start This may work... Cool Thx Vino
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop bash split boot: cannot open kernel/sparcv9/unix check if file exists command copy/move folder in unix curses.h cut command in unix find grep find mtime find null character in a unix file from ip can we get machine name +unix glance unix grep or grep recursive inaddr_any inappropriate ioctl for device known problems with fork unix c ksh if last login from unix lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace blank spaces by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix solaris change ip address stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix interview questions unix mtime unix.com vi substitute


All times are GMT -7. The time now is 06:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101