You are not logged in.

#1 2013-02-21 09:56:38

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 270

[SOLVED] openvpn issue: how to start service

Hi all,
I'm writing because I'm experiencing a problem while trying to start openvpn.
This morning I removed (i moved to .old)  the rc.conf file and this means i'm using a full systemd configuration.
The problem is that I don't know how to start openvpn. yesterday I was doing:

/etc/rc.d/openvpn start

today I tried again but it does not find such file: it is no more there :S

i started through:

openvpn /etc/openvpn/vpnname.conf

and it seems to work...but is this the only way? It produces lot of output, should I redirect it? I think I can but it's not the optimal solution

I need to start the service manually.

I tried:

# systemctl start openvpn@vpnname.service
Job for openvpn@vpnname.service failed. See 'systemctl status openvpn@vpnname.service' and 'journalctl -xn' for details.

# systemctl status openvpn@vpnname.service
openvpn@vpnname.service - OpenVPN connection to vpnname
	  Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; disabled)
	  Active: failed (Result: exit-code) since Thu 2013-02-21 10:37:58 CET; 11min ago
	 Process: 1950 ExecStart=/usr/sbin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i (code=exited, status=1/FAILURE)

Feb 21 10:37:58 jily systemd[1]: Starting OpenVPN connection to vpnname...
Feb 21 10:37:58 jily openvpn[1950]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/vpnname.conf
Feb 21 10:37:58 jily openvpn[1950]: Use --help for more information.
Feb 21 10:37:58 jily systemd[1]: openvpn@vpnname.service: control process exited, code=exited status=1
Feb 21 10:37:58 jily systemd[1]: Failed to start OpenVPN connection to vpnname.
Feb 21 10:37:58 jily systemd[1]: Unit openvpn@vpnname.service entered failed state
Feb 21 10:48:50 jily systemd[1]: Stopped OpenVPN connection to vpnname.

# journalctl -xn
-- Logs begin at Mon 2012-11-12 13:06:40 CET, end at Thu 2013-02-21 10:50:32 CET. --
Feb 21 10:49:39 jily ntpd[574]: peers refreshed
Feb 21 10:49:39 jily ntpd[574]: new interface(s) found: waking up resolver
Feb 21 10:49:48 jily ntpd[574]: Deleting interface #7 tun0, 10.8.0.21#123, interface stats: received=0, sent=0, dropped=0, active_time=9 secs
Feb 21 10:49:48 jily ntpd[574]: peers refreshed
Feb 21 10:50:32 jily systemd[1]: Starting OpenVPN connection to vpnname...
-- Subject: Unit openvpn@vpnname.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/7d4958e842da4a758f6c1cdc7b36dcc5
-- 
-- Unit openvpn@vpnname.service has begun starting up.
Feb 21 10:50:32 jily openvpn[2020]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/vpnname.conf
Feb 21 10:50:32 jily openvpn[2020]: Use --help for more information.
Feb 21 10:50:32 jily systemd[1]: openvpn@vpnname.service: control process exited, code=exited status=1
Feb 21 10:50:32 jily systemd[1]: Failed to start OpenVPN connection to vpnname.
-- Subject: Unit openvpn@vpnname.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit openvpn@vpnname.service has failed.
-- 
-- The result is failed.
Feb 21 10:50:32 jily systemd[1]: Unit openvpn@vpnname.service entered failed state

can you guys please help me understanding this?

Thanks in advance

Last edited by virusso80 (2013-04-03 07:54:59)

Offline

#2 2013-02-21 11:42:32

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] openvpn issue: how to start service

`systemctl enable openvpn@vpnname.service`

https://wiki.archlinux.org/index.php/Systemd


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#3 2013-02-21 12:49:01

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 270

Re: [SOLVED] openvpn issue: how to start service

hunterthomson wrote:

`systemctl enable openvpn@vpnname.service`

https://wiki.archlinux.org/index.php/Systemd

Thanks for the answer, but this enables the service at boot! I only want to use it manually!

Offline

#4 2013-02-21 13:03:56

ryan117
Member
Registered: 2013-02-05
Posts: 14

Re: [SOLVED] openvpn issue: how to start service

You can disable it from running at boot by doing this:

systemctl disable openvpn@vpnname.service

And start it manually by doing this:

systemctl start openvpn@vpnname.service

Last edited by ryan117 (2013-02-21 13:04:13)

Offline

#5 2013-02-21 13:05:25

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 270

Re: [SOLVED] openvpn issue: how to start service

ryan117 wrote:

You can disable it from running at boot by doing this:

systemctl disable openvpn@vpnname.service

And start it manually by doing this:

systemctl start openvpn@vpnname.service

thanks ryan BUT the start command doesn't work! I posted the error message. this is why i'm asking sad

Offline

#6 2013-02-21 13:33:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] openvpn issue: how to start service

virusso80 wrote:

i started through:

openvpn /etc/openvpn/vpnname.conf

and it seems to work...

A bit vague there - does it or doesn't it?

virusso80 wrote:
Feb 21 10:37:58 jily openvpn[1950]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/vpnname.conf

This error is generated by openvpn itself, not systemd. What are the ownership/permissions of /etc/openvpn/vpnname.conf?

Offline

#7 2013-02-21 13:36:57

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 270

Re: [SOLVED] openvpn issue: how to start service

tomk wrote:
virusso80 wrote:

i started through:

openvpn /etc/openvpn/vpnname.conf

and it seems to work...

A bit vague there - does it or doesn't it?

yes, it does! smile

tomk wrote:
virusso80 wrote:
Feb 21 10:37:58 jily openvpn[1950]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/vpnname.conf

This error is generated by openvpn itself, not systemd. What are the ownership/permissions of /etc/openvpn/vpnname.conf?

the following. I didn't change anything in that setting.

# ls -l /etc/openvpn/vpnname.conf
-rwx------ 1 root root 347 Sep 18  2010 /etc/openvpn/vpnname.conf

thanks

Offline

#8 2013-02-21 16:47:49

chris_l
Member
Registered: 2010-12-01
Posts: 389

Re: [SOLVED] openvpn issue: how to start service

Why don't you post your vpnname.conf ? Just censor any sensible data (probably that would be only your hostname/ip)

And like tomk said, you have a problem with your vpn configuration, is not systemd related. (maybe you should change the name of the thread?)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#9 2013-04-03 07:54:30

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 270

Re: [SOLVED] openvpn issue: how to start service

as chris_l stated or maybe argued, the problem was that i mispelled the service name...while starting it! everything works correctly.
by the way, thanks a lot smile

marked as solved

Offline

Board footer

Powered by FluxBB