Run openvpn server at boot

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

Run openvpn server at boot

Postby gcp900 » Tue Mar 03, 2015 10:54 pm

Hello guys!!

Probably this is a very simple question but I can not find the correct way to do it. I have got a raspberry pi running arch linux with an openvpn server installed. The openvpn server is well configurated but I can not set it up to run at the start of the system. I have read about the systemctl command and I tried to configure the server as it is written in the archwiki. The command I use in the shell to start the server is "openvpn /etc/openvpn/server.conf". As you can see I have to call the program and specify the location of the server config file. How can I do this with the systemctl command?

Thanks a lot!!
Last edited by gcp900 on Wed Mar 04, 2015 8:38 am, edited 1 time in total.
gcp900
 
Posts: 9
Joined: Tue Mar 03, 2015 10:51 pm

Re: Run openvpn server at boot

Postby WarheadsSE » Tue Mar 03, 2015 11:56 pm

You've read about it, apparently, but not about how to use it. It is right there in the wiki.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Run openvpn server at boot

Postby Socaltom » Wed Mar 04, 2015 12:12 am

$this->bbcode_second_pass_quote('gcp900', 'H')ello guys!!

Probably this is a very simple question but I can not find the correct way to do it. I have got a raspberry pi running arch linux with an openvpn server installed. The openvpn server is well configurated but I can not set it up to run at the start of the system. I have read about the systemctl command and I tried to configure the server as is written in the archwiki. The command I use in the shell to start the server is "openvpn /etc/openvpn/server.conf". As you can see I have to call the program and specify the location of the server config file. How can I do this with the systemctl command?

Thanks a lot!!


To start openvpn type
$this->bbcode_second_pass_code('', 'systemctl start openvpn@server')

to set it to autostart.

$this->bbcode_second_pass_code('', 'systemctl enable openvpn@server')

Just enable it once, and it will be automatically started at boot after that
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: Run openvpn server at boot

Postby gcp900 » Wed Mar 04, 2015 8:37 am

$this->bbcode_second_pass_quote('Socaltom', '
')
To start openvpn type
$this->bbcode_second_pass_code('', 'systemctl start openvpn@server')

to set it to autostart.

$this->bbcode_second_pass_code('', 'systemctl enable openvpn@server')

Just enable it once, and it will be automatically started at boot after that


I tried that but it didn't work either. In the shell command I have to specify the location of the server.conf file. As I have read in the wiki it could be "openvpn@etc-openvpn-server" maybe, as in that way I do the same with the systemctl command.

$this->bbcode_second_pass_quote('WarheadsSE', 'Y')ou've read about it, apparently, but not about how to use it. It is right there in the wiki.

I told at the beginning I had already read the wiki but it didn't work for me.
Last edited by gcp900 on Mon Mar 09, 2015 12:10 pm, edited 1 time in total.
gcp900
 
Posts: 9
Joined: Tue Mar 03, 2015 10:51 pm
Top

Re: Run openvpn server at boot

Postby gcp900 » Wed Mar 04, 2015 1:30 pm

It didn't work either. Any idea?
gcp900
 
Posts: 9
Joined: Tue Mar 03, 2015 10:51 pm

Re: Run openvpn server at boot

Postby WarheadsSE » Wed Mar 04, 2015 1:58 pm

Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Run openvpn server at boot

Postby Socaltom » Wed Mar 04, 2015 8:34 pm

$this->bbcode_second_pass_quote('gcp900', '')$this->bbcode_second_pass_quote('Socaltom', '
')
To start openvpn type
$this->bbcode_second_pass_code('', 'systemctl start openvpn@server')

to set it to autostart.

$this->bbcode_second_pass_code('', 'systemctl enable openvpn@server')

Just enable it once, and it will be automatically started at boot after that


I tried that but it didn't work either. In the shell command I have to specify the location of the server.conf file. As I have read in the wiki it could be "openvpn@etc-openvpn-server" maybe, as in that way I do the same with the systemctl command.

$this->bbcode_second_pass_quote('WarheadsSE', 'Y')ou've read about it, apparently, but not about how to use it. It is right there in the wiki.

I told at the beginning I had already read in the wiki but it didn't work for me.


If you installed it from the package, then it defaults to /etc/openvpn as the location for the log file.

Try this,

First reboot, so everything is clear,
then type
$this->bbcode_second_pass_code('', 'systemctl start openvpn@server')
Then post any messages you get
then type
$this->bbcode_second_pass_code('', 'systemctl status openvpn@server')
and post any messages you get.
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side
Top

Re: Run openvpn server at boot

Postby gcp900 » Mon Mar 09, 2015 12:18 pm

$this->bbcode_second_pass_quote('', 'h')ttp://fedoraproject.org/wiki/Openvpn#W ... th_systemd


It gives me an error at the point "restorecon -Rv /etc/openvpn". It doesn't recognaise that command. Anyway that's for Fedora not Archlinux ARM. I know Arch linux is based in Fedora but It could be different in some points, if not it would be the same.

$this->bbcode_second_pass_quote('', 'I')f you installed it from the package, then it defaults to /etc/openvpn as the location for the log file.

Try this,

First reboot, so everything is clear,
then type

Code: Select all
systemctl start openvpn@server


Then post any messages you get
then type

Code: Select all
systemctl status openvpn@server


and post any messages you get.


I installed it from the repositories but I have to specify the route for the server.conf file anyway.

I am going to type your commands as soon as I can and I will post the messages.

Thanks a lot for your help.
gcp900
 
Posts: 9
Joined: Tue Mar 03, 2015 10:51 pm
Top

Re: Run openvpn server at boot

Postby WarheadsSE » Mon Mar 09, 2015 1:52 pm

$this->bbcode_second_pass_quote('gcp900', 'I')t gives me an error at the point "restorecon -Rv /etc/openvpn". It doesn't recognaise that command.

Then look into that fact, perhaps something might be missing, or have changed since that guide was written.
$this->bbcode_second_pass_quote('gcp900', 'A')nyway that's for Fedora not Archlinux ARM. I know Arch linux is based in Fedora but It could be different in some points, if not it would be the same.

No, Arch is not based in any way on Fedora. They do however both use systemd and openvpn, and the configurations should be distro portable.

$this->bbcode_second_pass_quote('gcp900', '
')I installed it from the repositories but I have to specify the route for the server.conf file anyway.

I have looked at the service files, and they do appear to behave as currently documented. The fact you have to change this makes me wonder what is not standard on your system.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm
Top

Re: Run openvpn server at boot

Postby gcp900 » Mon Mar 09, 2015 5:18 pm

$this->bbcode_second_pass_quote('', 'I') have looked at the service files, and they do appear to behave as currently documented. The fact you have to change this makes me wonder what is not standard on your system.


I know it is strange, but take a look at what I get when I type "openvpn server.conf" (which should be enough if we put the files in the default route /etc/openvpn/):

$this->bbcode_second_pass_code('', '[root@alarmpi ~]# openvpn server.conf
Options error: In [CMD-LINE]:1: Error opening configuration file: server.conf
Use --help for more information.')

So I don't know what's wrong. Anyway, it happens the same in all computers I have installed openvpn as a client. I have to specify the route of the conf files even being in the default route (/etc/openvpn).

Finally, this is what I get when I type the restorecon command:

$this->bbcode_second_pass_code('', '[root@alarmpi ~]# restorecon -Rv /etc/openvpn
-bash: restorecon: command not found
')
gcp900
 
Posts: 9
Joined: Tue Mar 03, 2015 10:51 pm
Top

Next

Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 16 guests