Open Misiu opened 2 years ago
I've changed the logon account to:
and now the service starts.
I think the problem was with the account that is used for log on.
So instead of ZARZĄDZANIE NT\USŁUGA SIECIOWA
(NT AUTHORITY\NETWORK SERVICE
) I must use Usługa sieciowa
(Network Service
)
Can someone confirm this bug?
I've done some tests, and when I install (my own) service via PInvoke it is installed correctly and starts and runs without any problem. I'm also setting the permissions, so the service will work as Network Service.
The main difference between my code and the runner code is that I'm installing the service as local account and setting the permissions separately.
Here the service is installed using one call: https://github.com/actions/runner/blob/be9632302ceef50bfb36ea998cea9c94c75e5d4d/src/Runner.Listener/Configuration/NativeWindowsServiceHelper.cs#L486
svcHndl = CreateService(scmHndl,
serviceName,
serviceDisplayName,
ServiceRights.AllAccess,
SERVICE_WIN32_OWN_PROCESS,
ServiceBootFlag.AutoStart,
ServiceError.Normal,
runnerServiceExecutable,
null,
IntPtr.Zero,
null,
logonAccount,
logonPassword);
in my installer I'm doing this as two steps:
service = CreateService(scm, serviceName, displayName, ServiceAccessRights.AllAccess, SERVICE_WIN32_OWN_PROCESS, ServiceBootFlag.AutoStart, ServiceError.Normal,
fileName, null, IntPtr.Zero, null, null, null);
if (!ChangeServiceConfig(service, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE, null, null, IntPtr.Zero, null, logonAccount, logonPassword, null))
{
throw new ApplicationException("Unable to set permissions");
}
Can someone explain to me what is the difference? Why the service can't start when it is set to NT AUTHORITY\NETWORK SERVICE
?
I've changed the logon account to:
and now the service starts. I think the problem was with the account that is used for log on. So instead of
ZARZĄDZANIE NT\USŁUGA SIECIOWA
(NT AUTHORITY\NETWORK SERVICE
) I must useUsługa sieciowa
(Network Service
)Can someone confirm this bug?
Yes, same here with Win10. And your workaround fixes it, so thanks a lot for that :)
Wow, bug open for quite some time. This is essential for having the runner run on Windows
Describe the bug I've downloaded the latest version of the agent and I wanted to install it as a windows service. I am able to run the agent as a standalone app without any problems, but It can't start the windows service.
To Reproduce Steps to reproduce the behavior:
Expected behavior Windows service should start without any problems
Runner Version and Platform
Version of your runner? v2.283.1
OS of the machine running the runner? Windows 10 Pro 21H1 19043.1237 Polish language
What's not working?
Job Log Output
If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.
Runner and Worker's Diagnostic Logs
The service is installed with the default settings. The logon account is set to:
When I search this account on my PC I have this available: there is
USŁUGA SIECIOWA
but without theZARZĄDZANIE NT
prefix.