tags:

views:

91

answers:

1

Hi,

i'm making an app that needs to be up and running at all times. (24/7) I'm not very expirienced with services, but I read on the internet that services can be made uncolasble by setting their "onclose" property to false.

I have got the service monitoring my app, and the service can't be closed directly from the task manager services window... but, when I click "go to process" task manager leads me to the process the service spawned. From there I can close the process and instantly close the service. Since I don't have much expirience with services i'm wondering, is this behavior normal? If not, how to make the service unstopable?

A: 

It sounds like you need something like Slife Teams and then use Windows security to prevent them killing the client app.

Edit If you are using Windows 7 or Windows Server 2008 R2 maybe you can use AppLocker?

Edit 2 Getting back to answering the original question, one way would be to create your monitoring app so that there are two processes running, both monitoring, that know about each other.

Run the two processes, each with an open handle to the other process. When one process is detected as being killed the other process immediately restarts it, and vice-versa.

You will need to handle the normal system shutdown messages.

Or... have a read of this article: Process Invincibility

Tony
A rootkit? You gotta be kidding.
Hans Passant
Personally I wouldn't use it but I thought I'd include it in my answer for completeness. :)
Tony
Yeah, thanks for the anwser, but rootkits are not an option :)
Andrej
I dind't really expect you to go for that part of the answer :) Personally, I'd use the two processes "supporting" each other, even if only one of them is doing the actual monitoring.
Tony
yeah, that was my second option.. did that today and it works... it looks a bit ugly heaving two unnecessary processes in the task manager, but it does the trick...
Andrej