Phil
Phil

Reputation: 139

NSSM: Can't open service! OpenService(): Access is denied

I'm trying to install selenium-server-standalone-3.141.59.jar as an nssm service. It installs fine but when I try to run it, I get an error.

I installed via: PS C:\Users\MyUser> nssm install selenium-server java -jar "C:\selenium\selenium-server-standalone-3.141.59.jar

Then running nssm start selenium-server gives me OpenService(): Access is denied.

I tried to follow this but linking to the batch file didn't work either: NSSM: Can't edit a service I created

Upvotes: 2

Views: 14051

Answers (3)

Manu Kast
Manu Kast

Reputation: 3

Struggled with the same issue. Fixed it!

The reason was, that the nssm executable also has to be accessible by the given service user, which was not the case in my setting.

Resolution:

  1. Create local user
  2. Ensure local user has rights to run as a service (https://learn.microsoft.com/en-us/system-center/scsm/enable-service-log-on-sm?view=sc-sm-2019) - Local Group Policy
  3. Have the nssm.exe ALSO accessible by the created user

Upvotes: 0

dd619
dd619

Reputation: 6170

I was facing same issue, I did following steps:

1)Check the current status of service using nssm status service_name

2)Close command prompt

3)Run command prompt in Administrator mode

4)Execute nssm start service_name

Upvotes: 0

Phil
Phil

Reputation: 139

The problem seems to have fixed itself, I restarted my computer and it seems to be running! Previously, it didn't let me run it on demand so anyone having this problem can just try a restart.

UPDATE: I believe it's because I did not launch Powershell in admin mode on Windows 10, try that if you have problems.

Upvotes: 2

Related Questions