Multiple services, access denied on start

539 views
Skip to first unread message

Phil Jones

unread,
May 23, 2013, 9:33:53 AM5/23/13
to topshelf-discuss
Hi,

I am using a CI server to install multiple instances of my TopShelf
services, the services are in different locations on disk and have
different app.configs.

I have used SetDisplayName(serviceName) and
SetServiceName(serviceName) and SetInstanceName(serviceName) to make
sure the names are unique per service that gets installed.

I have 2 installed and I can only have 1 running at a time, the other
starts but throws an error: "Windows could not start the Foo.EN
(Instance: Foo.EN) service on Local Computer. Error 5: Access is
denied."

The Windows service is executing:

"C:\Foo.EN\processor\v6\Foo.Processor.exe" -instance
"Foo.Processor.EN" -displayname "Foo.Processor.EN (Instance:
Foo.Processor.EN)" -servicename "Foo.Processor.EN"

And the other:

"C:\Foo.DE\processor\v6\Foo.Processor.exe" -instance
"Foo.Processor.DE" -displayname "Foo.Processor.DE (Instance:
Foo.Processor.DE)" -servicename "Foo.Processor.DE"

Which to me seems right.

I can't see anything else in the documentation I need to set to allow
me to run multiple versions?

Travis Smith

unread,
May 23, 2013, 9:42:15 AM5/23/13
to topshelf...@googlegroups.com
Hmm, I can run multiples - and do in all environments currently - of the same service with different configs successfully (and installed via CI). Works On My Machine(TM) isn't the most helpful...

So let's try a few things, what happens if you manually start the processes? If different orders? Is it only when via CI? Is the old service still running or are files still being copied while start is called? You say the service starts? Are logs created at all? Can you run them via the console both at the same time?

-Travis



--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Phil Jones

unread,
May 23, 2013, 9:53:22 AM5/23/13
to topshelf-discuss
Ah, I feel like such a newbie.

I tried your suggestion of running them via command line (.exe run)
and it turns out there is a bug in the port configuration that the
built in OWIN host uses. The two services were trying to share the
same port! Not particually helpful Event Log as it just shows "access
denied". Oh well, that explains it and it's my problem!

Apologies!

Travis Smith

unread,
May 23, 2013, 10:26:01 AM5/23/13
to topshelf...@googlegroups.com
Happy to help you find the problem. Gotta start somewhere, and you're right. Errors can be obtuse. 

-Travis

sum...@adept-software.com

unread,
Dec 2, 2015, 5:11:14 AM12/2/15
to topshelf-discuss
Hi,
I am facing the same issue even if I have configured different ports. And both are running fine from console app. Access denied is coming when I am starting it from service. I have used OWIN hosting along with Topself.
Reply all
Reply to author
Forward
0 new messages