What would be a good way to check programmatically whether a service was
running?
We have a service that dies periodically and I need to check to see if this
service is running. I know how to check to see if the status is in stopped
or running mode. But that doesn't tell me if it is actually running.
I need to know this so that if it happens I can programmatically start the
same service on another machine.
What I would like to do is build a service that just periodically checks
(about once a minute) to see if the other service is actually running.
Thanks,
Tom 12 14429
Hello tshad,
If you are not the author of service you definitely can't know running it
or not, because for example web-Methods Server services start really running
after 20 mins as service set "running" status.
The only way to check whether it run is to check that files/environment that
service control
tWhat would be a good way to check programmatically whether a service
twas running?
t>
tWe have a service that dies periodically and I need to check to see
tif this service is running. I know how to check to see if the status
tis in stopped or running mode. But that doesn't tell me if it is
tactually running.
t>
tI need to know this so that if it happens I can programmatically
tstart the same service on another machine.
t>
tWhat I would like to do is build a service that just periodically
tchecks (about once a minute) to see if the other service is actually
trunning.
t>
tThanks,
t>
tTom
t>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
"Michael Nemtsev" <ne*****@msn.comwrote in message
news:9c**************************@msnews.microsoft .com...
Hello tshad,
If you are not the author of service you definitely can't know running it
or not, because for example web-Methods Server services start really
running after 20 mins as service set "running" status.
I am the author of the service.
But I have a service that sends out emails that shows in running mode and
for some reason it dies once every 5 or 6 days and seems to be frozen (could
be in an infinite loop - but I can't find where that would happen). The
status in the services windows or when I request it from another program
shows it as running (which would make sense if it never hit the Stop code.
I need to find a good way to monitor it to tell if it has stopped or not
(until I can find the problem with the code).
BTW, when I get to this point, I can't stop the program at all. I need to
reboot the server to get it released.
>
The only way to check whether it run is to check that files/environment
that service control
Not sure what you mean here.
Thanks,
Tom
tWhat would be a good way to check programmatically whether a service
twas running?
ttWe have a service that dies periodically and I need to check to see
tif this service is running. I know how to check to see if the status
tis in stopped or running mode. But that doesn't tell me if it is
tactually running.
ttI need to know this so that if it happens I can programmatically
tstart the same service on another machine.
ttWhat I would like to do is build a service that just periodically
tchecks (about once a minute) to see if the other service is actually
trunning.
ttThanks,
ttTom
t---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
Hello tshad,
I'm not sure that such brutal way to fix you service is a good way :)
Why not to make some internal check, for example whether email was send or
not or for example each day in midnight restart service.
t"Michael Nemtsev" <ne*****@msn.comwrote in message
tnews:9c**************************@msnews.microsof t.com...
t>
>Hello tshad,
If you are not the author of service you definitely can't know running it or not, because for example web-Methods Server services start really running after 20 mins as service set "running" status.
tI am the author of the service.
t>
tBut I have a service that sends out emails that shows in running mode
tand for some reason it dies once every 5 or 6 days and seems to be
tfrozen (could be in an infinite loop - but I can't find where that
twould happen). The status in the services windows or when I request
tit from another program shows it as running (which would make sense
tif it never hit the Stop code.
t>
tI need to find a good way to monitor it to tell if it has stopped or
tnot (until I can find the problem with the code).
t>
tBTW, when I get to this point, I can't stop the program at all. I
tneed to reboot the server to get it released.
t>
>The only way to check whether it run is to check that files/environment that service control
tNot sure what you mean here.
t>
tThanks,
t>
tTom
t>
>tWhat would be a good way to check programmatically whether a service twas running? ttWe have a service that dies periodically and I need to check to see tif this service is running. I know how to check to see if the status tis in stopped or running mode. But that doesn't tell me if it is tactually running. ttI need to know this so that if it happens I can programmatically tstart the same service on another machine. ttWhat I would like to do is build a service that just periodically tchecks (about once a minute) to see if the other service is actually trunning. ttThanks, ttTom t--- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
On way would be to have teh service right to a db table every now and
then, and have another service that monitors that table.
Although trying to figure out why the service dies would be a better
solution.
andy
tshad wrote:
"Michael Nemtsev" <ne*****@msn.comwrote in message
news:9c**************************@msnews.microsoft .com...
Hello tshad,
If you are not the author of service you definitely can't know running it
or not, because for example web-Methods Server services start really
running after 20 mins as service set "running" status.
I am the author of the service.
But I have a service that sends out emails that shows in running mode and
for some reason it dies once every 5 or 6 days and seems to be frozen (could
be in an infinite loop - but I can't find where that would happen). The
status in the services windows or when I request it from another program
shows it as running (which would make sense if it never hit the Stop code.
I need to find a good way to monitor it to tell if it has stopped or not
(until I can find the problem with the code).
BTW, when I get to this point, I can't stop the program at all. I need to
reboot the server to get it released.
The only way to check whether it run is to check that files/environment
that service control
Not sure what you mean here.
Thanks,
Tom
tWhat would be a good way to check programmatically whether a service
twas running?
ttWe have a service that dies periodically and I need to check to see
tif this service is running. I know how to check to see if the status
tis in stopped or running mode. But that doesn't tell me if it is
tactually running.
ttI need to know this so that if it happens I can programmatically
tstart the same service on another machine.
ttWhat I would like to do is build a service that just periodically
tchecks (about once a minute) to see if the other service is actually
trunning.
ttThanks,
ttTom
t---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
"Michael Nemtsev" <ne*****@msn.comwrote in message
news:9c**************************@msnews.microsoft .com...
Hello tshad,
I'm not sure that such brutal way to fix you service is a good way :)
This is more of a bandaid until I figure out what the problem is.
Part of the problem may be that the program was originally written in VS
2002 and I heard there was some problem with services it built. I did
rebuild it in 2003 and it seems to work better, but I can't be sure yet.
I also am writing trace statements to a text file at various points in the
program to try an figure out what it does just before it dies (or appears to
die).
Why not to make some internal check, for example whether email was send or
not or for example each day in midnight restart service.
The first would be doable, but the 2nd wouldn't help. We can't wait for
possibly 12 hours for the reboot to take place as the emails wouldn't be
sent out in time.
The other problem would be how to start the same service on another server
if we determine that the program quits working (checking the email records
to see if they were sent as you suggest, for example). Not sure how to do
that yet.
Thanks,
Tom
>
t"Michael Nemtsev" <ne*****@msn.comwrote in message
tnews:9c**************************@msnews.microsof t.com...
t>
>>Hello tshad,
If you are not the author of service you definitely can't know running it or not, because for example web-Methods Server services start really running after 20 mins as service set "running" status.
tI am the author of the service.
ttBut I have a service that sends out emails that shows in running
mode
tand for some reason it dies once every 5 or 6 days and seems to be
tfrozen (could be in an infinite loop - but I can't find where that
twould happen). The status in the services windows or when I request
tit from another program shows it as running (which would make sense
tif it never hit the Stop code.
ttI need to find a good way to monitor it to tell if it has stopped or
tnot (until I can find the problem with the code).
ttBTW, when I get to this point, I can't stop the program at all. I
tneed to reboot the server to get it released.
t>
>>The only way to check whether it run is to check that files/environment that service control
tNot sure what you mean here.
ttThanks,
ttTom
t>
>>tWhat would be a good way to check programmatically whether a service twas running? ttWe have a service that dies periodically and I need to check to see tif this service is running. I know how to check to see if the status tis in stopped or running mode. But that doesn't tell me if it is tactually running. ttI need to know this so that if it happens I can programmatically tstart the same service on another machine. ttWhat I would like to do is build a service that just periodically tchecks (about once a minute) to see if the other service is actually trunning. ttThanks, ttTom t--- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
"Andy" <aj*****@alum.rit.eduwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
On way would be to have teh service right to a db table every now and
then, and have another service that monitors that table.
That is what I may do in the mean time.
Although trying to figure out why the service dies would be a better
solution.
Am working on that now, but need a band aid at the moment.
Thanks,
Tom
>
andy
tshad wrote:
>"Michael Nemtsev" <ne*****@msn.comwrote in message news:9c**************************@msnews.microsof t.com...
Hello tshad,
If you are not the author of service you definitely can't know running
it
or not, because for example web-Methods Server services start really
running after 20 mins as service set "running" status.
I am the author of the service.
But I have a service that sends out emails that shows in running mode and for some reason it dies once every 5 or 6 days and seems to be frozen (could be in an infinite loop - but I can't find where that would happen). The status in the services windows or when I request it from another program shows it as running (which would make sense if it never hit the Stop code.
I need to find a good way to monitor it to tell if it has stopped or not (until I can find the problem with the code).
BTW, when I get to this point, I can't stop the program at all. I need to reboot the server to get it released.
>
The only way to check whether it run is to check that files/environment
that service control Not sure what you mean here.
Thanks,
Tom
tWhat would be a good way to check programmatically whether a service
twas running?
ttWe have a service that dies periodically and I need to check to
see
tif this service is running. I know how to check to see if the
status
tis in stopped or running mode. But that doesn't tell me if it is
tactually running.
ttI need to know this so that if it happens I can programmatically
tstart the same service on another machine.
ttWhat I would like to do is build a service that just periodically
tchecks (about once a minute) to see if the other service is actually
trunning.
ttThanks,
ttTom
t---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
There's a ServiceController class, I'm pretty sure its in .Net 1.1 too.
Andy
tshad wrote:
"Andy" <aj*****@alum.rit.eduwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
On way would be to have teh service right to a db table every now and
then, and have another service that monitors that table.
That is what I may do in the mean time.
Although trying to figure out why the service dies would be a better
solution.
Am working on that now, but need a band aid at the moment.
Thanks,
Tom
"Andy" <aj*****@alum.rit.eduwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
There's a ServiceController class, I'm pretty sure its in .Net 1.1 too.
That was what I was looking for.
Thanks,
Tom
>
Andy
tshad wrote:
>"Andy" <aj*****@alum.rit.eduwrote in message news:11**********************@b28g2000cwb.googleg roups.com...
On way would be to have teh service right to a db table every now and
then, and have another service that monitors that table.
That is what I may do in the mean time.
Although trying to figure out why the service dies would be a better
solution.
Am working on that now, but need a band aid at the moment.
Thanks,
Tom
Hello tshad,
Take into account that in some cases this isn't the solution, even if the
service status is in running status it may be hunged or smth
t"Andy" <aj*****@alum.rit.eduwrote in message
tnews:11**********************@i42g2000cwa.googleg roups.com...
t>
>There's a ServiceController class, I'm pretty sure its in .Net 1.1 too.
tThat was what I was looking for.
t>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
"Michael Nemtsev" <ne*****@msn.comwrote in message
news:9c**************************@msnews.microsoft .com...
Hello tshad,
Take into account that in some cases this isn't the solution, even if the
service status is in running status it may be hunged or smth
I agree.
I can do as was suggested about checking the DB to see if my emails were
sent. Since I know when the email records were written to the file, I can
do a check every 5 minutes or so to see if there are any email 5 minutes
and if so, stop the service (even if it is hung - shouldn't hurt), then
start the service on a different service and send and email that this
process happened so we can restart the machine.
It would be nice to restart the machine remotely also (not sure how to do
that yet).
Thanks,
Tom
>
t"Andy" <aj*****@alum.rit.eduwrote in message
tnews:11**********************@i42g2000cwa.googleg roups.com...
t>
>>There's a ServiceController class, I'm pretty sure its in .Net 1.1 too.
tThat was what I was looking for.
t>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
WMI and System.Management is what you need to look at.
See your other thread for a reply.
Willy.
"tshad" <ts**********@ftsolutions.comwrote in message
news:OA*************@TK2MSFTNGP06.phx.gbl...
| "Michael Nemtsev" <ne*****@msn.comwrote in message
| news:9c**************************@msnews.microsoft .com...
| Hello tshad,
| >
| Take into account that in some cases this isn't the solution, even if
the
| service status is in running status it may be hunged or smth
|
| I agree.
|
| I can do as was suggested about checking the DB to see if my emails were
| sent. Since I know when the email records were written to the file, I can
| do a check every 5 minutes or so to see if there are any email 5 minutes
| and if so, stop the service (even if it is hung - shouldn't hurt), then
| start the service on a different service and send and email that this
| process happened so we can restart the machine.
|
| It would be nice to restart the machine remotely also (not sure how to do
| that yet).
|
| Thanks,
|
| Tom
|
| >
| t"Andy" <aj*****@alum.rit.eduwrote in message
| tnews:11**********************@i42g2000cwa.googleg roups.com...
| t>
| >>There's a ServiceController class, I'm pretty sure its in .Net 1.1
| >>too.
| >>>
| tThat was what I was looking for.
| t>
| ---
| WBR,
| Michael Nemtsev :: blog: http://spaces.msn.com/laflour
| >
| "At times one remains faithful to a cause only because its opponents do
| not cease to be insipid." (c) Friedrich Nietzsche
| >
| >
|
|
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:OH****************@TK2MSFTNGP06.phx.gbl...
WMI and System.Management is what you need to look at.
See your other thread for a reply.
Looking at that now.
Thanks,
Tom
>
Willy.
"tshad" <ts**********@ftsolutions.comwrote in message
news:OA*************@TK2MSFTNGP06.phx.gbl...
| "Michael Nemtsev" <ne*****@msn.comwrote in message
| news:9c**************************@msnews.microsoft .com...
| Hello tshad,
| >
| Take into account that in some cases this isn't the solution, even if
the
| service status is in running status it may be hunged or smth
|
| I agree.
|
| I can do as was suggested about checking the DB to see if my emails were
| sent. Since I know when the email records were written to the file, I
can
| do a check every 5 minutes or so to see if there are any email 5
minutes
| and if so, stop the service (even if it is hung - shouldn't hurt), then
| start the service on a different service and send and email that this
| process happened so we can restart the machine.
|
| It would be nice to restart the machine remotely also (not sure how to
do
| that yet).
|
| Thanks,
|
| Tom
|
| >
| t"Andy" <aj*****@alum.rit.eduwrote in message
| tnews:11**********************@i42g2000cwa.googleg roups.com...
| t>
| >>There's a ServiceController class, I'm pretty sure its in .Net 1.1
| >>too.
| >>>
| tThat was what I was looking for.
| t>
| ---
| WBR,
| Michael Nemtsev :: blog: http://spaces.msn.com/laflour
| >
| "At times one remains faithful to a cause only because its opponents
do
| not cease to be insipid." (c) Friedrich Nietzsche
| >
| >
|
|
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brad Jones |
last post by:
Hello, I'm hoping someone can give me some help or guidance here. I'm not
sure if this is even the best group to post to for this.
Our OEM equipment's software architecture relies heavily on a...
|
by: Mike |
last post by:
I want to create a windows service that will monitor another window service.
what i need for the service to do is, if a service is stopped I need it to
start the service back up
example:
...
|
by: Chris Podmore |
last post by:
I don't know if this is the correct newsgroup but I couldn't find one for Windows Services
Is it possible to check that a Windows Service is still running from another machine
The idea being a...
|
by: Doug Bailey |
last post by:
I am trying to control a Windows Service via a Web Service interface.
(I am developing in .NET2003) I am using the ServiceController object
which allows me to read the state of the services with...
|
by: Tony |
last post by:
Every 10 seconds I need to search a SQL table for orders to print. The orders
are created through WebForms on ASP.NET clients. The orders should not print
until
10 minutes before they are due.
...
|
by: deko |
last post by:
When to use a privileged user thread rather than a windows service?
That's the question raised in a previous post . It was suggested that if the service needs to interact
with a WinForms app...
|
by: Joris De Groote |
last post by:
Hi,
can vb check if a windows service is running or not? ( Webclient )
Thanks
Joris
|
by: tshad |
last post by:
What would be a good way to check programmatically whether a service was
running?
We have a service that dies periodically and I need to check to see if this
service is running. I know how to...
|
by: Shadlan |
last post by:
Hi.
I need to know if a service is running on my server. Is there any PHP
instruction that I can use to do this?
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
|
by: SueHopson |
last post by:
Hi All,
I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...
| |