Problem with stopping services in FB7

Hi Guys,

I have a problem when stopping a service on our buildserver running TFS. The user running the buildserver is Local Admin.
I have tried stopping the service with PowerShell and also the "Control NT Service"-task. When the TFSBuildService is starting the FB7-script the services can´t be stopped due to user permissions i guess. The service i am trying to stop currently runs under the same user as the TFSBuildService user.

If i log on to the server with the same account i have no problem running the FB7-project, the service stops without any problems. 

When I run the "Control NT Service"-task or PowerShell we get an error:

"Control NT Service"-task:
Access is denied.

PowerShell:
[Stop-Service WatchDog]
       Stop-Service : Service 'WatchDog (WatchDog)' cannot be stopped due to the
        following error: Cannot open WatchDog service on computer '.'.
       At line:1 char:16
       + & {Stop-Service <<<<  WatchDog}
           + CategoryInfo          : CloseError: (System.ServiceProcess.ServiceContro
    ller:ServiceController) [Stop-Service], ServiceCommandException
           + FullyQualifiedErrorId : CouldNotStopService,Microsoft.PowerShell.Command
    s.StopServiceCommand

Is there anyone out ther which can help me?

 

Thanks

Hi Sebastian,
So you’re running TFS as your CI server which is launching FB? If that’s the case it should simply be running FBCMD (the command line version of FB) - as far as I’m aware there’s nothing special we do in terms of permissions.

A quick Google didn’t turn much up, but it does seem that AVG has service called WatchDog. It could be that it’s scanning FBCMD and therefore blocking the service from stopping.

Ben

Hi Ben,

Thank you for your answer.

Yes that´s correct TFS is launching FB. I have tried finding some information on this issue with Google and i couldn´t find anything. We don't have AVG (or any other antivirus) installed on the server.

The part that i find make no sense is that the service that im trying to stop runs on the same user and server as the TFS-service that starts the FB. Still im getting Access Denied.

We are currently running the trial version of FB. If i just can get the services to stop and start then our evaluation is complete and we are looking to buy a license.

//Sebastian
 

Just an idea, but try specifying a machine name rather than leaving it blank. It shouldn’t matter but I have seen stranger things. Also, when running under TFS, FinalBuilder (fbcmd) is launched with the permissions that the TFS Build service has, it’s possible the the user the service runs under does not have permission to control services.

HTH