Hi,

Sometimes the semaphore used to avoid parallel net commands fails to lock
on windows. This happens only when a previous run was terminated (say by
ctrl-C) at a time when the register-dns commands are running -- ie. after
"initialization completed" but before the "net commands" are done.

Could be reproduced only if at least one other openvpn process is up and
running in the background as well. So I suspect this is what happens:

As openvpn forks before running register-dns commands, the semaphore is
locked in the child (not using interactive service). When the parent is
terminated with the child still active, it seems the child terminates
abnormally, leaving the semaphore locked. Subsequent processes cannot
anymore get a lock on it.

As Windows clears semaphores when all open handles to it are gone, this is
a problem only when there is one or more other openvpn processes running.

Any suggestions on how to fix this?

Selva

Bonus question: write a unit test that anticipates this and catches it :-)

Reply via email to