[DEV,1/3] ovpnmain.cgi: Allow the openvpn-rw status to be shown in openvpn WUI

Message ID 20241214174718.22140-1-adolf.belka@ipfire.org
State New
Headers
Series [DEV,1/3] ovpnmain.cgi: Allow the openvpn-rw status to be shown in openvpn WUI |

Commit Message

Adolf Belka Dec. 14, 2024, 5:47 p.m. UTC
  - The main openvpn process name has been changed to openvpn-rw. This change is needed
   so that if openvpn-rw is running the status shows that on the OpenVPN WUI page

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 html/cgi-bin/ovpnmain.cgi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
 mode change 100755 => 100644 html/cgi-bin/ovpnmain.cgi
  

Comments

Adolf Belka Dec. 14, 2024, 6:04 p.m. UTC | #1
Hi Michael,

This patch set allows the status of the openvpn roadwarrior to be shown on the OpenVPN and Services WUI pages when you first enable or when you reboot and also fixes a typo.

However, if the server is actually running by checking the init.d status and the WUI page says it is running, if I then press the Save button on the Openvpn WUI page it restarts the openvpn rw server but then fails to restart properly. It shuts down the openvpn-authenticator with an OK but for the openvpn daemon it shows FAIL.

The daemon is actually stopped but the openvpn-rw.pid file is not removed from the /var/run directory and so it gives a FAIL result. This also then stops the server starting back up as the pid file is there but openvpn is not running.

I have tried the above also with the init.d commands from the cli.

I have tried various changes to the initscript and have been unable to find anything that will remove the pid file as part of the killproc step.

I tried out having killproc -p /var/run/openvpn-rw.pid /usr/sbin/openvpn and the pid file was still left behind after the killproc step.

I don't understand enough about the pid things in the IPFire initscripts to be able to fault find this any further. Sorry.

Regards,

Adolf.


On 14/12/2024 18:47, Adolf Belka wrote:
> - The main openvpn process name has been changed to openvpn-rw. This change is needed
>     so that if openvpn-rw is running the status shows that on the OpenVPN WUI page
> 
> Tested-by: Adolf Belka <adolf.belka@ipfire.org>
> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
> ---
>   html/cgi-bin/ovpnmain.cgi | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>   mode change 100755 => 100644 html/cgi-bin/ovpnmain.cgi
> 
> diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> old mode 100755
> new mode 100644
> index bd102f4bc..843edc519
> --- a/html/cgi-bin/ovpnmain.cgi
> +++ b/html/cgi-bin/ovpnmain.cgi
> @@ -2,7 +2,7 @@
>   ###############################################################################
>   #                                                                             #
>   # IPFire.org - A linux based firewall                                         #
> -# Copyright (C) 2007-2023  IPFire Team  <info@ipfire.org>                     #
> +# Copyright (C) 2007-2024  IPFire Team  <info@ipfire.org>                     #
>   #                                                                             #
>   # This program is free software: you can redistribute it and/or modify        #
>   # it under the terms of the GNU General Public License as published by        #
> @@ -5063,8 +5063,8 @@ END
>   	# Show the service status
>   	&Header::ServiceStatus({
>   		$Lang::tr{'ovpn roadwarrior server'} => {
> -			"process" => "openvpn",
> -			"pidfile" => "/var/run/openvpn.pid",
> +			"process" => "openvpn-rw",
> +			"pidfile" => "/var/run/openvpn-rw.pid"
>   		}
>   	});
>
  

Patch

diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
old mode 100755
new mode 100644
index bd102f4bc..843edc519
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -2,7 +2,7 @@ 
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2023  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2024  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -5063,8 +5063,8 @@  END
 	# Show the service status
 	&Header::ServiceStatus({
 		$Lang::tr{'ovpn roadwarrior server'} => {
-			"process" => "openvpn",
-			"pidfile" => "/var/run/openvpn.pid",
+			"process" => "openvpn-rw",
+			"pidfile" => "/var/run/openvpn-rw.pid"
 		}
 	});