On Thu, 04 Aug 2005 21:01:40 +0530, Mrinal Kamboj wrote:
Doubt may be bit trivial , but i wanted to know , what are the exact
benefits derived while we run a background process as an NT service in
windows , we can as well achieve the functionality using standalone exe
, which will keep on running in a loop and do the job till been messaged
to stop .
Essentially , i want the key advantages of implementing process daemons
as an NT Service in windows .
Basically, a Windows service is just like a normal Windows application
except that:
- a windows service starts as soon as Windows starts (if it is set to start
automatically) before any user logs in
- it runs constantly in the background even if there are no users logged
in. It remains running even when all the users log out
- there is always only one instance of your Windows service running even if
several interactive Windows users are logged in simultaneously
- the service control manager (SCM) lets you decide what to do if your
service crashes. You can tell the service control manager to restart the
service, restart the computer or run an executable if your service crashes
(which could for example notify you of the problem by sending an email)
- You can access the SCM remotely (provided that you have sufficient right
to do so), which allows you to monitor your service remotely
- a Windows service doesn't (well, shouldn't) have any UI
- Only administrators can start and stop a Windows Service (that's if your
service is running under the Local System account, i'm not sure of what
happens if you choose to run it under another user account)
That's all i can think of for now.