Project

General

Profile

Bug #1204

OpenVPN

Added by bigfoot65 almost 7 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Apps
Target version:
Start date:
12/09/2013
Due date:
% Done:

0%


Description

OpenVPN for Amahi 7 works, but the server tab reflects the service as being stopped. Further investigation noted that the is actually named openvpn@.service in /lib/systemd/services.

The current Amahi platform does not appear to be compatible with the service naming in this case. If the entry in the servers tab of hda_production is changed from openvpn@amahi to openvpn, the server feature begins to work again.

History

#1 Updated by bigfoot65 over 6 years ago

As a work around, do the following as root user:

cd /lib/systemd/system
mv openvpn\@.service openvpn\@amahi.service
systemctl --system daemon-reload
systemctl restart openvpn\@amahi.service

Check the server status and it should be working now. We will need to modify the app to correctly name the service by adding the escape (\) before the @ in the file name.

#2 Updated by bigfoot65 over 6 years ago

Added work around to app. Tested and server feature is now working. Also monit was not restarting it due to the file name issue, but is doing it now.

#3 Updated by bigfoot65 over 6 years ago

This appears to be a defect with the RPM install of OpenVPN. Not sure if there is much we can do about it other than what has been implemented now in the app.

Recommend closing this one and possibly filing a bug with Fedora.

#4 Updated by bigfoot65 over 6 years ago

Well thought I had the server feature fixed, but does not appear so. Since there is no actual in /lib/systemd/system, monit for some reason does not see it correctly.

If you do systemctl status , it reflects all is ok. The PID is in /var/run/openvpn as amahi.pid. It all is correctly reflected in the /etc/monit.d/openvpn@.conf as well.

The only way to get it working correctly seems to copy the openvpn@.service to in /lib/systemd/system. That does seem like the right way to do things though, so unsure what is best.

#5 Updated by bigfoot65 over 6 years ago

bigfoot65 wrote:
As a work around, do the following as root user:

cd /lib/systemd/system
cp openvpn\@.service openvpn\@amahi.service
systemctl --system daemon-reload
systemctl restart openvpn\@amahi.service

Check the server status and it should be working now. We will need to modify the app to correctly name the service by adding the escape (\) before the @ in the file name.

#6 Updated by bigfoot65 over 6 years ago

bigfoot65 wrote:
As a work around, do the following as root user:

cd /lib/systemd/system
cp openvpn\@.service openvpn\@amahi.service
systemctl --system daemon-reload
systemctl restart openvpn\@amahi.service

Check the server status and it should be working now.

#7 Updated by bigfoot65 over 6 years ago

Please ignore the duplication in history. The bug tracker does not have edit capabilities. Sorry for all the extra fluff.

#8 Updated by bigfoot65 over 6 years ago

Ok, found the problem with the server feature. It's a permissions issue with /var/run/openvpn.

When the app is installed, that directory is chmod 755. All works fine and the server shows up. When you reboot, the directory resorts back to different permissions so the server feature cannot read it.

Not sure the best way to correct this problem. Had the same issue with SABnzbd, COuchPotato and others. The only way I could get it to work correctly was by placing the PID file in /var/run without the subdirectory.

#9 Updated by uumickey over 6 years ago

As requested in the forums.

I just got my Amahi system up and running. I purchased the OpenVPN app and installed it on the system, however, the service will not start. Every time I press Start or Restart in the web control panel it spins for a bit and then comes back with a red light, not running.

I can't find any logs that might tell me why it is refusing to start. Note, this is not connectivity related but just trying to start the process.

[root@localhost ~]# chmod 755 -R /var/run/openvpn
[root@localhost ~]# systemctl status openvpn\amahi.service
openvpn@amahi.service - OpenVPN Robust And Highly Flexible Tunneling Application On amahi
Loaded: loaded (/usr/lib/systemd/system/openvpn
.service; disabled)
Active: inactive (dead)

OpenVPN service still shows as down in the control panel. However, I notice from the startup scripts that it is looking for interface tun0. I don't have a tun0:

[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:25:22:b3:79:6a brd ff:ff:ff:ff:ff:ff
inet 192.168.XX.XXX/24 brd 192.168.11.255 scope global em1
valid_lft forever preferred_lft forever
inet6 fe80::225:22ff:feb3:796a/64 scope link
valid_lft forever preferred_lft forever

Also available in: Atom