Page 1 of 1

[SOLVED] phantom processes

Posted: Mon Oct 31, 2011 12:59 pm
by johnmb
Related to a previous issue had raised when I was having difficulty with the linux client, there is
a strange behaviour, that I can work around by manually killing processes, however it clearly
isn't correct behaviour.

At all times, the server behaves correctly; it is the behaviour of the linux client that is at issue.
I can start the client and the session starts correctly and I can use the session without problems.
Then I shut down the client session using CTRL C and the transcript of the client indicates that all has shut down correctly upon reception of the signal. Then I type:-

ps aux | grep openvpn

This shows me that there are no residual openvpn related processes left running; again what I expected.
Then I shut down the linux box (sudo shutdown -h now) and restart. When the linux box has fully restarted
back to my shell window command line, I again type "ps aux | grep openvpn" but this time I get the
following:-

root 2833 0.0 0.1 4532 2080 ? Ss 12:44 0:00 /usr/sbin/openvpn --writepid /var/run/openvpn.client.pid --daemon ovpn-client --status /var/run/openvpn.client.status 10 --cd /etc/openvpn --config /etc/openvpn/client.conf
root 2843 0.0 0.0 4532 1432 ? Ss 12:44 0:00 /usr/sbin/openvpn --writepid /var/run/openvpn.rclient.pid --daemon ovpn-rclient --status /var/run/openvpn.rclient.status 10 --cd /etc/openvpn --config /etc/openvpn/rclient.conf

Where did that come from ? If I try to open an OpenVPN session withlout killing these two processes,
the session fails to start properly and I can't see my remote LAN. I have to kill these two processes and then
the session will start OK.

Any ideas on this ?

Re: phantom processes

Posted: Mon Oct 31, 2011 1:31 pm
by janjust
your linux distro seems to have an /etc/init.d/openvpn script which launches all files found in /etc/openvpn; right now you have two files, client.conf and rclient.conf

This is linux distro dependent, so have a look at the init.d scripts for details.

Re: phantom processes

Posted: Mon Oct 31, 2011 4:52 pm
by johnmb
Thanks, you're right; if I type:-

sudo /etc/init.d/openvpn stop

then start the client - all works OK. I suppose it assumes that I want the server running
from system start when, in actual fact, I only ever want to run the client. I'll have to think
about the way I want to run openvpn for the future.

Thanks for your help

Re: phantom processes

Posted: Mon Oct 31, 2011 4:54 pm
by johnmb
Beg your pardon - runs both clients from system start; as you said.

Re: phantom processes

Posted: Tue Nov 01, 2011 9:35 am
by johnmb
I found the best way forward, rather than messing around with the startup script itself, was to place the client conf files in a subdirectory under /etc/openvpn rather than directly in that directory. This way the startup script doesn't see them and doesn't try to start them (I have one conf file to use within our building across the corporate network to openvpn and hence to the separate local sub-net and another for access from anywhere else on the internet). Also, any upgrade to OpenVPN that might re-instate the startup script doesn't cause a problem.

Thank you once again - problem solved

Re: phantom processes

Posted: Tue Nov 01, 2011 11:06 am
by janjust
thanks for sharing your tips!
Closing topic