Question

I have a process A launched as a windows service (user = System). I also have a process B that I launch under my own account (in group Administrators).

I have observed several behaviours :

1- process A is launched as windows service (user System) first. Then process B will NOT run (user is admin) : it can be started but it closes immediately without error, even in windows events.

2- process B is launched (user is admin) first, it runs OK. Then process A is started as windows service (user System) and everything works fine.

3- process A is launched as windows service (run as admin) first. Then process B is launched (user is admin) and everything works fine.

4- process A is launchd as windows service (user System) first. Then process B is launched as windows service too (user System). Everything works fine.

It seems to me that there is a problem in the configuration of some rights but I can't find which one. Also, process A and process B use some DLLs in common so maybe the problem can be there but again I can't find which is the faulty dll.

I hope some of you guys can help me to figure it out ! The usecase I want to run is the number 1.

Frederic

Was it helpful?

Solution

The problem is that one of the dlls uses shared memory and mutex. If a process A runs as super user, the shared memory and mutex are created with super user privileges.

The process B launched with lower user privileges will fail to initialize or re-use shared memory and mutex because it has not enough privileges to do so.

Solutions in my case : Solution 1- stop using shared memory and mutex in dlls. Solution 2- be able to continue in degraded mode even if the shared memory or mutex can't be created/accessed. Solution 3- run both process with the same user.

I will take solution 2 because it fits the best to my usecase.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top