[Openvpn-devel,v1] contrib, sample: drop SysV-era init scripts

Message ID 20261116095438.11288-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] contrib, sample: drop SysV-era init scripts |

Commit Message

Gert Doering Nov. 16, 2026, 9:54 a.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

multilevel-init.patch patches the init script removed in 57ec6cec
("cleanup: Remove RPM openvpn.spec build approach").
openvpn-startup.sh and openvpn-shutdown.sh are superseded by the
systemd units in distro/systemd.

Change-Id: Icb79564ae4e0df1dcdd4a3734bd45f9513f56111
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2186
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2186
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Comments

Gert Doering Nov. 16, 2026, 12:27 p.m. UTC | #1
The sheer horror... while I do have a liking for SysV init scripts,
*these* were just not very good, not even as an examples... out, out.

(And since it's really like "nobody should be using those", out of 2.7
as well).

Tested 2.7 with a "make distcheck" - Patches that add or remove files
have a tendency to break "make dist".  But these were not shipped in
the tarballs, so really really unimportant cruft.

Your patch has been applied to the master and release/2.7 branch.

commit b0668301ed71e90dfed96c4e5bfafdbe2000ed93 (master)
commit b884018db65ea823643678f66431eab552455b31 (HEAD -> release/2.7)
Author: Razvan Cojocaru
Date:   Mon Nov 16 10:54:32 2026 +0100

     contrib, sample: drop SysV-era init scripts

     Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2186
     Message-Id: <20261116095438.11288-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg41407.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/contrib/multilevel-init.patch b/contrib/multilevel-init.patch
deleted file mode 100644
index 8d48fbc..0000000
--- a/contrib/multilevel-init.patch
+++ /dev/null
@@ -1,79 +0,0 @@ 
---- /etc/init.d/openvpn	2004-05-12 20:30:06.000000000 +0200
-+++ openvpn	2004-05-12 20:34:33.000000000 +0200
-@@ -58,13 +58,13 @@
- #     returning success or failure status to caller (James Yonan).
- 
- # Location of openvpn binary
--openvpn="/usr/sbin/openvpn"
-+openvpn=/usr/sbin/openvpn
- 
- # Lockfile
--lock="/var/lock/subsys/openvpn"
-+lock=/var/lock/subsys/openvpn
- 
- # PID directory
--piddir="/var/run/openvpn"
-+piddir=/var/run/openvpn
- 
- # Our working directory
- work=/etc/openvpn
-@@ -106,7 +106,7 @@
- 
- 	if [ -f $lock ]; then
- 	    # we were not shut down correctly
--	    for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
-+	    for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
- 	      if [ -s $pidf ]; then
- 		kill `cat $pidf` >/dev/null 2>&1
- 	      fi
-@@ -116,12 +116,12 @@
- 	    sleep 2
- 	fi
- 
--	rm -f $piddir/*.pid $piddir/*/*.pid
-+	find $piddir -name "*.pid"|xargs rm -f
- 
- 	# Start every .conf in $work and run .sh if exists
- 	errors=0
- 	successes=0
--	for c in `/bin/ls *.conf */*.conf 2>/dev/null`; do
-+	for c in `find * -name "*.conf" 2>/dev/null`; do
- 	    bn=${c%%.conf}
- 	    if [ -f "$bn.sh" ]; then
- 		. $bn.sh
-@@ -147,7 +147,7 @@
- 	;;
-   stop)
- 	echo -n $"Shutting down openvpn: "
--	for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
-+	for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
- 	  if [ -s $pidf ]; then
- 	    kill `cat $pidf` >/dev/null 2>&1
- 	  fi
-@@ -163,7 +163,7 @@
- 	;;
-   reload)
- 	if [ -f $lock ]; then
--	    for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
-+	    for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
- 		if [ -s $pidf ]; then
- 		    kill -HUP `cat $pidf` >/dev/null 2>&1
- 		fi
-@@ -175,7 +175,7 @@
- 	;;
-   reopen)
- 	if [ -f $lock ]; then
--	    for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
-+	    for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
- 		if [ -s $pidf ]; then
- 		    kill -USR1 `cat $pidf` >/dev/null 2>&1
- 		fi
-@@ -195,7 +195,7 @@
- 	;;
-   status)
- 	if [ -f $lock ]; then
--	    for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
-+	    for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
- 		if [ -s $pidf ]; then
- 		    kill -USR2 `cat $pidf` >/dev/null 2>&1
- 		fi
diff --git a/sample/sample-config-files/openvpn-shutdown.sh b/sample/sample-config-files/openvpn-shutdown.sh
deleted file mode 100755
index 8ed2d1d..0000000
--- a/sample/sample-config-files/openvpn-shutdown.sh
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#!/bin/sh
-
-# stop all openvpn processes
-
-killall -TERM openvpn
diff --git a/sample/sample-config-files/openvpn-startup.sh b/sample/sample-config-files/openvpn-startup.sh
deleted file mode 100755
index 0ee006b..0000000
--- a/sample/sample-config-files/openvpn-startup.sh
+++ /dev/null
@@ -1,34 +0,0 @@ 
-#!/bin/sh
-
-# A sample OpenVPN startup script
-# for Linux.
-
-# openvpn config file directory
-dir=/etc/openvpn
-
-# load the firewall
-$dir/firewall.sh
-
-# load TUN/TAP kernel module
-modprobe tun
-
-# enable IP forwarding
-echo 1 > /proc/sys/net/ipv4/ip_forward
-
-# Invoke openvpn for each VPN tunnel
-# in daemon mode.  Alternatively,
-# you could remove "--daemon" from
-# the command line and add "daemon"
-# to the config file.
-#
-# Each tunnel should run on a separate
-# UDP port.  Use the "port" option
-# to control this.  Like all of
-# OpenVPN's options, you can
-# specify "--port 8000" on the command
-# line or "port 8000" in the config
-# file.
-
-openvpn --cd $dir --daemon --config vpn1.conf
-openvpn --cd $dir --daemon --config vpn2.conf
-openvpn --cd $dir --daemon --config vpn2.conf