Discussion:
[Openvpn-users] Windows openvpnservice (openvpnserv2) starting of its own accord ?
debbie10t
2017-02-20 12:44:37 UTC
Permalink
Hi,

I am a little bit rusty with windows and I can't figure out how this is
happening.

Computer is Windows 7 Home

Openvpn 2.4.0 standard install + easyrsa

Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!

Can anybody please explain why this service is being started ?
I have run out of ideas ..

Thanks
Gert Doering
2017-02-20 13:09:53 UTC
Permalink
Hi,
Post by debbie10t
I am a little bit rusty with windows and I can't figure out how this is
happening.
Computer is Windows 7 Home
Openvpn 2.4.0 standard install + easyrsa
Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!
Can anybody please explain why this service is being started ?
I have run out of ideas ..
No of these services should ever start at *logon* - iservice should start
on boot, the others only if enabled in the services control panel.

gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany ***@greenie.muc.de
fax: +49-89-35655025 ***@net.informatik.tu-muenchen.de
Samuli Seppänen
2017-02-20 15:09:57 UTC
Permalink
Post by Gert Doering
Hi,
Post by debbie10t
I am a little bit rusty with windows and I can't figure out how this is
happening.
Computer is Windows 7 Home
Openvpn 2.4.0 standard install + easyrsa
Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!
Can anybody please explain why this service is being started ?
I have run out of ideas ..
No of these services should ever start at *logon* - iservice should start
on boot, the others only if enabled in the services control panel.
gert
Debbie10t: can you launch Powershell and issue

Get-WMIObject -Class win32_service -Filter "Name='OpenVPNService'"

With default settings it should output this:

ExitCode : 0
Name : OpenVpnService
ProcessId : 0
StartMode : Manual
State : Stopped
Status : Ok

If "StartMode" is truly set to Manual, yet after a reboot "State" says
"Running", then we have a genuine problem.

On Windows 10 certain funkiness would be expected due to the "Fast
Startup" feature, which means that instead of actually powering down, it
sneakily hibernates:

<https://community.openvpn.net/openvpn/ticket/804>
--
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
Samuli Seppänen
2017-02-20 16:36:07 UTC
Permalink
Post by Samuli Seppänen
Post by Gert Doering
Hi,
Post by debbie10t
I am a little bit rusty with windows and I can't figure out how this is
happening.
Computer is Windows 7 Home
Openvpn 2.4.0 standard install + easyrsa
Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!
Can anybody please explain why this service is being started ?
I have run out of ideas ..
No of these services should ever start at *logon* - iservice should start
on boot, the others only if enabled in the services control panel.
gert
Debbie10t: can you launch Powershell and issue
Get-WMIObject -Class win32_service -Filter "Name='OpenVPNService'"
ExitCode : 0
Name : OpenVpnService
ProcessId : 0
StartMode : Manual
State : Stopped
Status : Ok
If "StartMode" is truly set to Manual, yet after a reboot "State" says
"Running", then we have a genuine problem.
Could you run the above Get-WMIObject command just in case? That would
help rule out the possibility that the graphical UI is confused about
the StartupType of OpenVpnService.

Samuli
debbie10t
2017-02-20 17:32:46 UTC
Permalink
Post by Samuli Seppänen
Post by Samuli Seppänen
Debbie10t: can you launch Powershell and issue
Get-WMIObject -Class win32_service -Filter "Name='OpenVPNService'"
ExitCode : 0
Name : OpenVpnService
ProcessId : 0
StartMode : Manual
State : Stopped
Status : Ok
If "StartMode" is truly set to Manual, yet after a reboot "State" says
"Running", then we have a genuine problem.
Could you run the above Get-WMIObject command just in case? That would
help rule out the possibility that the graphical UI is confused about
the StartupType of OpenVpnService.
(Knowing about Windows Faststart #804)

Stop running openvpnserv2 + openvpn.exe
REBOOT

Result of powershell:

ExitCode: 0
Name: OpenVPNService
ProcessID: 2324
StartMode: Manual
State: Running
Status: OK

Weird ?

Thanks for your help :)
Regards
Selva Nair
2017-02-20 17:45:47 UTC
Permalink
Post by debbie10t
Stop running openvpnserv2 + openvpn.exe
REBOOT
ExitCode: 0
Name: OpenVPNService
ProcessID: 2324
StartMode: Manual
State: Running
Status: OK
Weird ?
A shot in the dark.. May be some event is triggering to start it. Does

sc qtriggerinfo OpenVPNService

show anything?

Any scheduled tasks (taskschd) that could be starting it?

Selva
debbie10t
2017-02-20 20:01:07 UTC
Permalink
Post by Selva Nair
Post by debbie10t
Stop running openvpnserv2 + openvpn.exe
REBOOT
ExitCode: 0
Name: OpenVPNService
ProcessID: 2324
StartMode: Manual
State: Running
Status: OK
Weird ?
A shot in the dark.. May be some event is triggering to start it. Does
sc qtriggerinfo OpenVPNService
show anything?
RESULT:

The service openvpnservice has not registered for any start or stop
triggers.
Post by Selva Nair
Any scheduled tasks (taskschd) that could be starting it?
Nothing in Windows Scheduled Tasks other than the usual MS crap
eg: Customer Experience Improvement Program

Although, I am not overly familiar with this version of windows
scheduled tasks. If there is a command/powershell I can run .. ?

Also, nothing in 'at'

Also, although some time ago, it is the sort of thing I may have done
to setup some dumb hack to start the service, this is a New service so
anything I did before should not effect this service name .. ?

Thanks for the help :)
Selva Nair
2017-02-20 20:22:29 UTC
Permalink
Post by debbie10t
Post by Selva Nair
Any scheduled tasks (taskschd) that could be starting it?
Nothing in Windows Scheduled Tasks other than the usual MS crap
eg: Customer Experience Improvement Program
Although, I am not overly familiar with this version of windows
scheduled tasks. If there is a command/powershell I can run .. ?
schtasks /query /fo list

Use msconfig to disable startup processes and/or services to isolate the
what causes this. You will have to reboot several times using a bisecting
approach -- disable half of the start up items, then quarter etc and the
same for services... Powershell gurus may be able to automate this...

Selva
debbie10t
2017-02-20 21:50:50 UTC
Permalink
Post by Selva Nair
Post by debbie10t
Post by Selva Nair
Any scheduled tasks (taskschd) that could be starting it?
Nothing in Windows Scheduled Tasks other than the usual MS crap
eg: Customer Experience Improvement Program
Although, I am not overly familiar with this version of windows
scheduled tasks. If there is a command/powershell I can run .. ?
schtasks /query /fo list
nothing to do with openvpn that i can see .. but ..
Post by Selva Nair
Use msconfig to disable startup processes and/or services to isolate the
what causes this. You will have to reboot several times using a bisecting
approach -- disable half of the start up items, then quarter etc and the
same for services... Powershell gurus may be able to automate this...
1st step i elected was to set openvpn Ineractive service to manual
along with *all* openvpn services set to manual. Then stop all those
services and reboot.

Result upon reboot openvpnserv2 *is* started while other openvpn
services are not. The openvpn log shows that it is started not continued.

I expect this will turn out to have nothing to do with openvpn but ..

I will try the bisect approach, thanks
Selva Nair
2017-02-20 22:04:07 UTC
Permalink
Post by debbie10t
Post by Selva Nair
Use msconfig to disable startup processes and/or services to isolate the
what causes this. You will have to reboot several times using a bisecting
approach -- disable half of the start up items, then quarter etc and the
same for services... Powershell gurus may be able to automate this...
1st step i elected was to set openvpn Ineractive service to manual
along with *all* openvpn services set to manual. Then stop all those
services and reboot.
Result upon reboot openvpnserv2 *is* started while other openvpn services
are not. The openvpn log shows that it is started not continued.
Any service set to depend on openvpnservice?

sc enumdepend openvpnservice
Post by debbie10t
I expect this will turn out to have nothing to do with openvpn but ..
I will try the bisect approach, thanks
Bisect is going to be painful and wont catch complex dependencies like if a
and b are started then start the service. But I've no better suggestions.

Selva
debbie10t
2017-02-20 22:36:28 UTC
Permalink
Post by Selva Nair
Post by debbie10t
Post by Selva Nair
Use msconfig to disable startup processes and/or services to isolate the
what causes this. You will have to reboot several times using a bisecting
approach -- disable half of the start up items, then quarter etc and the
same for services... Powershell gurus may be able to automate this...
1st step i elected was to set openvpn Ineractive service to manual
along with *all* openvpn services set to manual. Then stop all those
services and reboot.
Result upon reboot openvpnserv2 *is* started while other openvpn services
are not. The openvpn log shows that it is started not continued.
Any service set to depend on openvpnservice?
sc enumdepend openvpnservice
[SC] EnumDependentServices: entriesread = 0
Post by Selva Nair
Post by debbie10t
I expect this will turn out to have nothing to do with openvpn but ..
I will try the bisect approach, thanks
Bisect is going to be painful and wont catch complex dependencies like if a
and b are started then start the service. But I've no better suggestions.
Looks like my choices are quite limited ..
I've done similar before, just this time i'm a bit out of practice
I'll post relevant questions on the end of the thread
Or a solution .. if I work out what it is !

thanks for your help :)
Samuli Seppänen
2017-02-21 10:02:59 UTC
Permalink
Post by debbie10t
Post by Selva Nair
Post by debbie10t
Stop running openvpnserv2 + openvpn.exe
REBOOT
ExitCode: 0
Name: OpenVPNService
ProcessID: 2324
StartMode: Manual
State: Running
Status: OK
Weird ?
A shot in the dark.. May be some event is triggering to start it. Does
sc qtriggerinfo OpenVPNService
show anything?
The service openvpnservice has not registered for any start or stop
triggers.
Post by Selva Nair
Any scheduled tasks (taskschd) that could be starting it?
Nothing in Windows Scheduled Tasks other than the usual MS crap
eg: Customer Experience Improvement Program
Although, I am not overly familiar with this version of windows
scheduled tasks. If there is a command/powershell I can run .. ?
Also, nothing in 'at'
Also, although some time ago, it is the sort of thing I may have done
to setup some dumb hack to start the service, this is a New service so
anything I did before should not effect this service name .. ?
Well, the same service name ("OpenVPNService") was also used in OpenVPN
2.3 for the legacy automatic service. Any custom scripts that managed
the (now legacy) service in OpenVPN 2.3 continue to work in OpenVPN 2.4
- they just manage the new openvpnserv2.exe -based service now.

Samuli
Samuli Seppänen
2017-02-20 17:46:47 UTC
Permalink
Post by debbie10t
Post by Samuli Seppänen
Post by Samuli Seppänen
Debbie10t: can you launch Powershell and issue
Get-WMIObject -Class win32_service -Filter "Name='OpenVPNService'"
ExitCode : 0
Name : OpenVpnService
ProcessId : 0
StartMode : Manual
State : Stopped
Status : Ok
If "StartMode" is truly set to Manual, yet after a reboot "State" says
"Running", then we have a genuine problem.
Could you run the above Get-WMIObject command just in case? That would
help rule out the possibility that the graphical UI is confused about
the StartupType of OpenVpnService.
(Knowing about Windows Faststart #804)
Stop running openvpnserv2 + openvpn.exe
REBOOT
ExitCode: 0
Name: OpenVPNService
ProcessID: 2324
StartMode: Manual
State: Running
Status: OK
Weird ?
Thanks for your help :)
Regards
Very weird indeed.

Does the application event log show the usual message for starting
OpenVPNService? Here's a rather naty Powershell command-line to check
that out:

Get-EventLog Application|Where-Object { $_.Source -eq "OpenVPNService"
-and $_.Message -like "*started*" }|Select -Last 5

Or you can just use the Event Viewer. In any case you should see a
message "Service started successfully." with a timestamp that matches
the time you rebooted,

My hunch is that _something_ outside the usual boot procedure starts the
service.
--
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
debbie10t
2017-02-20 20:17:03 UTC
Permalink
Post by Samuli Seppänen
Post by debbie10t
Post by Samuli Seppänen
Post by Samuli Seppänen
Debbie10t: can you launch Powershell and issue
Get-WMIObject -Class win32_service -Filter "Name='OpenVPNService'"
ExitCode : 0
Name : OpenVpnService
ProcessId : 0
StartMode : Manual
State : Stopped
Status : Ok
If "StartMode" is truly set to Manual, yet after a reboot "State" says
"Running", then we have a genuine problem.
Could you run the above Get-WMIObject command just in case? That would
help rule out the possibility that the graphical UI is confused about
the StartupType of OpenVpnService.
(Knowing about Windows Faststart #804)
Stop running openvpnserv2 + openvpn.exe
REBOOT
ExitCode: 0
Name: OpenVPNService
ProcessID: 2324
StartMode: Manual
State: Running
Status: OK
Weird ?
Thanks for your help :)
Regards
Very weird indeed.
* gulp *
Post by Samuli Seppänen
Does the application event log show the usual message for starting
OpenVPNService? Here's a rather naty Powershell command-line to check
Get-EventLog Application|Where-Object { $_.Source -eq "OpenVPNService"
-and $_.Message -like "*started*" }|Select -Last 5
The last 5 reveal that the event log only knows about startup of the
service until 18/feb/2017 ... also shows the config starting.
Post by Samuli Seppänen
Or you can just use the Event Viewer. In any case you should see a
message "Service started successfully." with a timestamp that matches
the time you rebooted,
did not scroll back two days .. ran the above command instead
Post by Samuli Seppänen
My hunch is that _something_ outside the usual boot procedure starts the
service.
a virus ? starting openvpnservice .. is that likely ?
disk corruption .. well it is an old pc and has seen better days ..
but it seems to function ok for average $users activities !

If I disable the service it does *not* start.

I am stumped ..

Thanks for your help :)
debbie10t
2017-02-20 15:25:25 UTC
Permalink
Post by Gert Doering
Hi,
Post by debbie10t
I am a little bit rusty with windows and I can't figure out how this is
happening.
Computer is Windows 7 Home
Openvpn 2.4.0 standard install + easyrsa
Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!
Can anybody please explain why this service is being started ?
I have run out of ideas ..
No of these services should ever start at *logon* - iservice should start
on boot, the others only if enabled in the services control panel.
I have tested this *many* times because I was so surprised!
openvpnserv2 is being auto started somehow.

Some details:

I have
/program file/openvpn/config/tapserver.ovpn (one config file)
/user/*/openvpn/config/ (ZERO files)

I double checked, I have *never* installed nssm on this machine!

OpenvpnServ2 registry is set to:
Start 0x03 (3) Manual
Type 0x10 (16) ?

Openvpn Interactive Service registry is set to:
Start 0x02 (2) Auto
Type 0x10 (32) ?

I have checked all HKLM/HKCU:/../Run +Runonce (that I know of)

I have not made any changes from the default openvpn-2.4.0 install
except to turn off openvpn-gui autostart at logon. Everything else
is as default. Plus my single --dev tap --server config file (as above)

The Openvpn-Admin group has not been created as it is not required.

I understand this is not expected behaviour but I cannot work out
why it is being started.

My only assumption is that windows has screwed something up but ..
where to look ?

I have systernals autostart showing nothing unusual ..

UPDATE:

I have un+reinstalled openvpn-2.4.0 and the same behaviour occurs.
The only change I made from install is to rename the tap adapter
to coincide with the name used in the only config in
/program files/openvpn/config/tapserver.ovpn


After full reboot:
openvpnserv2 is starting.
There is a delay suggesting it is the "delayed auto-start" option being
used. The service manager shows as openvpnservice (serv2) Manual




*** If any other user has access to win7 and they can
test this for me I would appreciate your help.




Side note: after re-install the openvpn-gui is still set to *not*
run even though the installer is set to auto-load at user logon.
(registry not being updated during install?)

I am not in a rush to work this out, I was only using W7 to work
on #828 .. unfortunately, I cannot get access to the pc for a few
hours now (it is on facebook duty)


Thanks
debbie10t
2017-02-20 15:25:01 UTC
Permalink
Post by Gert Doering
Hi,
Post by debbie10t
I am a little bit rusty with windows and I can't figure out how this is
happening.
Computer is Windows 7 Home
Openvpn 2.4.0 standard install + easyrsa
Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!
Can anybody please explain why this service is being started ?
I have run out of ideas ..
No of these services should ever start at *logon* - iservice should start
on boot, the others only if enabled in the services control panel.
I have tested this *many* times because I was so surprised!
openvpnserv2 is being auto started somehow.

Some details:

I have
/program file/openvpn/config/tapserver.ovpn (one config file)
/user/*/openvpn/config/ (ZERO files)

I double checked, I have *never* installed nssm on this machine!

OpenvpnServ2 registry is set to:
Start 0x03 (3) Manual
Type 0x10 (16) ?

Openvpn Interactive Service registry is set to:
Start 0x02 (2) Auto
Type 0x10 (32) ?

I have checked all HKLM/HKCU:/../Run +Runonce (that I know of)

I have not made any changes from the default openvpn-2.4.0 install
except to turn off openvpn-gui autostart at logon. Everything else
is as default. Plus my single --dev tap --server config file (as above)

The Openvpn-Admin group has not been created as it is not required.

I understand this is not expected behaviour but I cannot work out
why it is being started.

My only assumption is that windows has screwed something up but ..
where to look ?

I have systernals autostart showing nothing unusual ..

UPDATE:

I have un+reinstalled openvpn-2.4.0 and the same behaviour occurs.
The only change I made from install is to rename the tap adapter
to coincide with the name used in the only config in
/program files/openvpn/config/tapserver.ovpn


After full reboot:
openvpnserv2 is starting.
There is a delay suggesting it is the "delayed auto-start" option being
used. The service manager shows as openvpnservice (serv2) Manual




*** If any other user has access to win7 and they can
test this for me I would appreciate your help.




Side note: after re-install the openvpn-gui is still set to *not*
run even though the installer is set to auto-load at user logon.
(registry not being updated during install?)

I am not in a rush to work this out, I was only using W7 to work
on #828 .. unfortunately, I cannot get access to the pc for a few
hours now (it is on facebook duty)


Thanks
debbie10t
2017-02-22 17:33:19 UTC
Permalink
Post by debbie10t
Hi,
I am a little bit rusty with windows and I can't figure out how this is
happening.
Computer is Windows 7 Home
Openvpn 2.4.0 standard install + easyrsa
Openvpn Interactive service = Auto, does start at logon OK
Openvpn Legacy service = Manual, does *not* start at logon OK
Openvpn service (openvpnserv2) = Manual, *Does* start at logon BAD!
Can anybody please explain why this service is being started ?
I have run out of ideas ..
Thanks
Thanks for all your help on this, I worked out what it was.

A long time ago (on a PC far away) ..

I setup an "automated" VPN solution, which would ensure the VPN
was running and restart on errors etc. The main reason for all
the "automation" was so that after connecting the client would
download "updates" (Lot's of air quotes .. it was a long time ago)

I used a product called Filewatcher for Windows, and it was
actually very robust .. so robust in fact, it took me all this time
to work out where the hell I had hidden it !

It was a "Hidden" scheduled Task .. and its name was not related
to openvpn so it took me ages to remember and find.

Anyway .. at least the problem had nothing to do with openvpn!
nor even windows! .. just $user (me) playing $admin .. D'oh!

Regards

Loading...