[英]Starting Windows Service with Domain User Gives: Error 5: Access is Denied
I have a Topshelf Windows Service that installs and starts just fine when I run it as local system
. 我有一个Topshelf Windows服务,可以在将其作为
local system
运行时安装并启动正常。
But when I switch to a domain user (or network service
), I get the following error: 但是当我切换到域用户(或
network service
)时,出现以下错误:
Windows could not start the My Cool Custom Service service on Local Computer.
Windows无法在本地计算机上启动My Cool Custom Service服务。
Error 5: Access is denied.
错误5:访问被拒绝。
I am left wondering if it is my domain user that I am running the service as that does not have permissions, or if it is me personally that does not have permissions to start a service as a non Local System
user. 我只是想知道是我的域用户在运行该服务,因为它没有权限,还是我个人没有权限以非
Local System
用户的身份启动服务。
How can I get this service to start up? 我如何才能启动此服务?
NOTES: 笔记:
Things I have tried: 我尝试过的事情:
MyCoolService.exe start
MyCoolService.exe start
The service failed to start., System.ServiceProcess.TimeoutException: Time out has expired and the operation has not been completed.
The service failed to start., System.ServiceProcess.TimeoutException: Time out has expired and the operation has not been completed.
I decided to try to work around this by running as Local System
and then impersonating the user I want to make my calls. 我决定尝试通过作为
Local System
运行,然后假冒我要拨打电话的用户来解决此问题。
Well, turns out that this issue is that my Windows Service starts up a self hosted SignalR service at startup. 好吧,事实证明,这个问题是我的Windows服务在启动时启动了自托管的SignalR服务。 That call is what was giving the
Access is Denied
error. 该呼叫正是导致“
Access is Denied
错误的原因。
If I let Local System
start the SignalR service then do the rest of the stuff with my domain user it works fine. 如果我让
Local System
启动SignalR服务,然后与我的域用户一起完成其余工作,则它可以正常工作。
(I will likely post a question on how to grant my user rights to start a SignalR service...) (我可能会发布有关如何授予我的用户启动SignalR服务的权限的问题...)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.