views:

136

answers:

2

I have some security related service running on my machine (start type = automatic) In the service control manager, the stop/restart commands are grayed out.

I was wondering how can I develop such service for which the stop operation is disallowed.

Note that I am logged in as an administrator

+4  A: 

All you need is to disallow your service to recieve stop requests.

Denis Krjuchkov
Still, given enough privileges an admin user could kill the process anyway.
Matteo Italia
So the CanStop is not related to privileges at all. Is it possible to do that privilege based?
Saar
A: 

Hi Jon.

Making the code changes outlined by Denis should improve the situation, but if your goal is to run your service 24/7 you may want to try Service Protector (http://www.coretechnologies.com/products/ServiceProtector/). It will automatically restart your service if it crashes, hangs or stops in any way, and send you email to let you know about it.

Good luck!

CoreTech
And what would prevent Service Protector itself from being stopped? Also, do you handle process suspension (as opposite to stopping)?
Eugene Mayevski 'EldoS Corp