Main Page | Report this Page
.NET DotNet Forum Index  »  Visual C# Forum  »  Windows service Rights question
Page 1 of 1    

Windows service Rights question

Author Message
Steve Long
Posted: Thu Sep 30, 2004 1:11 pm
Guest
In writing a Windows service with .NET, I'm noticing that the process for
some services can not be killed with specifically stopping the service. If
you try to kill the process with, say task manager, you get an access denied
message. I just wrote a test service and I can kill the process for this
service without actually stopping the service. Can someone tell me how to
keep the process for my service from being killed without actually stopping
the service?

I appreciate any insight into this thread.

Thanks
Steve
 
Brian Gideon
Posted: Thu Sep 30, 2004 1:51 pm
Guest
Steve,

I read through this several times, but I'm still not confident that I
understand what you mean. A user with administrative privledges on a
box will always be able to stop a service via the service control
manager or kill any process associated with a service on that box.
Though killing a process associated with service running under a
different login will require functionality that the task manager does
not provide, it is always possible. Normal users are unable stop a
service or kill a process associated with a service. If the process
associated with a service does not terminate after stopping the service
in the service control manager then there is a problem with your code.

Brian

Steve Long wrote:
Quote:
In writing a Windows service with .NET, I'm noticing that the process
for
some services can not be killed with specifically stopping the
service. If
you try to kill the process with, say task manager, you get an access
denied
message. I just wrote a test service and I can kill the process for
this
service without actually stopping the service. Can someone tell me
how to
keep the process for my service from being killed without actually
stopping
the service?

I appreciate any insight into this thread.

Thanks
Steve
 
Steve Long
Posted: Thu Sep 30, 2004 2:01 pm
Guest
Okay, there are processes running on my machine that just happen to also be
Windows services. I didn't write these services. If I open task manager and
try to kill the process, it won't kill it. However, if I go to the Services
Control Panel and stop the service, it kills the process. An example of this
is the McShield.exe service which is the virus checker running on my box. I
can't kill this process but I can stop the service, which kills the process.
I do have admin right on my box they say.

Steve

"Brian Gideon" <briangideon@gmail.com> wrote in message
news:1096573869.159874.226860@k17g2000odb.googlegroups.com...
Quote:
Steve,

I read through this several times, but I'm still not confident that I
understand what you mean. A user with administrative privledges on a
box will always be able to stop a service via the service control
manager or kill any process associated with a service on that box.
Though killing a process associated with service running under a
different login will require functionality that the task manager does
not provide, it is always possible. Normal users are unable stop a
service or kill a process associated with a service. If the process
associated with a service does not terminate after stopping the service
in the service control manager then there is a problem with your code.

Brian

Steve Long wrote:
In writing a Windows service with .NET, I'm noticing that the process
for
some services can not be killed with specifically stopping the
service. If
you try to kill the process with, say task manager, you get an access
denied
message. I just wrote a test service and I can kill the process for
this
service without actually stopping the service. Can someone tell me
how to
keep the process for my service from being killed without actually
stopping
the service?

I appreciate any insight into this thread.

Thanks
Steve
 
Brian Gideon
Posted: Thu Sep 30, 2004 2:36 pm
Guest
Steve,

I understand what are saying now. This is correct. Although you have
administrative priviledges on your box you will not be able to kill a
process running under the system account from the task manager. You
need to use kill.exe which comes with the resource kit or pskill.exe
which is free and can be downloaded from http://www.sysinternals.com.
I hope this helps.

Brian


Steve Long wrote:
Quote:
Okay, there are processes running on my machine that just happen to
also be
Windows services. I didn't write these services. If I open task
manager and
try to kill the process, it won't kill it. However, if I go to the
Services
Control Panel and stop the service, it kills the process. An example
of this
is the McShield.exe service which is the virus checker running on my
box. I
can't kill this process but I can stop the service, which kills the
process.
I do have admin right on my box they say.

Steve
 
Steve Long
Posted: Thu Sep 30, 2004 2:37 pm
Guest
Actually, I was wondering how to make my program behave like that too. Can
you help with that?

Steve

"Brian Gideon" <briangideon@gmail.com> wrote in message
news:1096576563.743420.173960@k26g2000oda.googlegroups.com...
Quote:
Steve,

I understand what are saying now. This is correct. Although you have
administrative priviledges on your box you will not be able to kill a
process running under the system account from the task manager. You
need to use kill.exe which comes with the resource kit or pskill.exe
which is free and can be downloaded from http://www.sysinternals.com.
I hope this helps.

Brian


Steve Long wrote:
Okay, there are processes running on my machine that just happen to
also be
Windows services. I didn't write these services. If I open task
manager and
try to kill the process, it won't kill it. However, if I go to the
Services
Control Panel and stop the service, it kills the process. An example
of this
is the McShield.exe service which is the virus checker running on my
box. I
can't kill this process but I can stop the service, which kills the
process.
I do have admin right on my box they say.

Steve

 
Brian Gideon
Posted: Thu Sep 30, 2004 2:48 pm
Guest
As far as I know your program should behave exactly the same way as
long as it is running under the system account. Are you saying that it
doesn't?

Steve Long wrote:
Quote:
Actually, I was wondering how to make my program behave like that
too. Can
you help with that?

Steve

"Brian Gideon" <briangideon@gmail.com> wrote in message
news:1096576563.743420.173960@k26g2000oda.googlegroups.com...
Steve,

I understand what are saying now. This is correct. Although you
have
administrative priviledges on your box you will not be able to kill
a
process running under the system account from the task manager.
You
need to use kill.exe which comes with the resource kit or
pskill.exe
which is free and can be downloaded from
http://www.sysinternals.com.
I hope this helps.

Brian

 
Steve Long
Posted: Fri Oct 01, 2004 11:53 am
Guest
Yes, I think that's what I'm saying. It fails to install unless I set the
Account property to User in the serviceProcessInstaller object.

Steve

"Brian Gideon" <briangideon@gmail.com> wrote in message
news:1096577297.935010.190520@k26g2000oda.googlegroups.com...
Quote:
As far as I know your program should behave exactly the same way as
long as it is running under the system account. Are you saying that it
doesn't?

Steve Long wrote:
Actually, I was wondering how to make my program behave like that
too. Can
you help with that?

Steve

"Brian Gideon" <briangideon@gmail.com> wrote in message
news:1096576563.743420.173960@k26g2000oda.googlegroups.com...
Steve,

I understand what are saying now. This is correct. Although you
have
administrative priviledges on your box you will not be able to kill
a
process running under the system account from the task manager.
You
need to use kill.exe which comes with the resource kit or
pskill.exe
which is free and can be downloaded from
http://www.sysinternals.com.
I hope this helps.

Brian


 
Brian Gideon
Posted: Fri Oct 01, 2004 1:32 pm
Guest
I have no idea why it won't install when set to LocalSystem. I've
never had that problem before.

Brian

Steve Long wrote:
Quote:
Yes, I think that's what I'm saying. It fails to install unless I set
the
Account property to User in the serviceProcessInstaller object.

Steve
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sat Nov 28, 2009 10:55 pm