From 198beee9b15742a578260bd417f2653b5d045c8a Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Wed, 6 May 2015 08:11:07 +0000 Subject: [PATCH] - killed systemd stuff --- openvpn-service-generator | 21 --------------------- openvpn-tunnel.upstart | 13 ------------- openvpn.spec | 36 ++---------------------------------- openvpn.target | 7 ------- openvpn.tmpfiles | 1 - openvpn.upstart | 33 --------------------------------- openvpn@.service | 16 ---------------- 7 files changed, 2 insertions(+), 125 deletions(-) delete mode 100644 openvpn-service-generator delete mode 100644 openvpn-tunnel.upstart delete mode 100644 openvpn.target delete mode 100644 openvpn.tmpfiles delete mode 100644 openvpn.upstart delete mode 100644 openvpn@.service diff --git a/openvpn-service-generator b/openvpn-service-generator deleted file mode 100644 index 5c05da1..0000000 --- a/openvpn-service-generator +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -destunitdir=${1:-/tmp} - -# Do nothing if target is disabled -[ -e /etc/systemd/system/multi-user.target.wants/openvpn.target ] || exit 0 - -[ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn - -if [ -d $destunitdir/openvpn.target.wants ]; then - rm -f $destunitdir/openvpn.target.wants/openvpn@*.service -else - mkdir -p $destunitdir/openvpn.target.wants -fi - -for tun in $TUNNELS; do - [ -L $destunitdir/openvpn.target.wants/openvpn@$tun.service ] && \ - continue - ln -s /lib/systemd/system/openvpn@.service \ - $destunitdir/openvpn.target.wants/openvpn@$tun.service -done diff --git a/openvpn-tunnel.upstart b/openvpn-tunnel.upstart deleted file mode 100644 index 381e5da..0000000 --- a/openvpn-tunnel.upstart +++ /dev/null @@ -1,13 +0,0 @@ -# openvpn tunnel daemon -# -# This service runs specified tunnel - -stop on pld.network-stopped - -manual - -#console output - -respawn -instance $TUNNEL -exec /usr/sbin/openvpn --config /etc/openvpn/$TUNNEL.conf --writepid /var/run/openvpn/$TUNNEL.pid --cd /etc/openvpn diff --git a/openvpn.spec b/openvpn.spec index 70eddeb..f8dfcba 100644 --- a/openvpn.spec +++ b/openvpn.spec @@ -13,10 +13,7 @@ Source0: http://swupdate.openvpn.net/community/releases/%{name}-%{version}.tar.g # Source0-md5: 6ca03fe0fd093e0d01601abee808835c Source1: %{name}.init Source2: %{name}.sysconfig -Source3: %{name}.tmpfiles -Source4: openvpn-service-generator -Source5: openvpn.target -Source6: openvpn@.service +Source3: %{name}-update-resolv-conf Patch0: %{name}-pam.patch URL: http://www.openvpn.net/ BuildRequires: autoconf >= 2.59 @@ -27,12 +24,9 @@ BuildRequires: openssl-devel >= 0.9.7d BuildRequires: pam-devel %{?with_pkcs11:BuildRequires: pkcs11-helper-devel} BuildRequires: rpmbuild(macros) >= 1.671 -BuildRequires: systemd-devel Requires(post,preun): /sbin/chkconfig -Requires(post,preun,postun): systemd-units >= 38 Requires: /sbin/ip Requires: rc-scripts >= 0.4.3.0 -Requires: systemd-units >= 38 Conflicts: kernel < 2.4 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -78,7 +72,6 @@ sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-re --enable-password-save \ --enable-iproute2 \ --enable-selinux \ - --enable-systemd \ IFCONFIG=/sbin/ifconfig \ IPROUTE=/sbin/ip \ ROUTE=/sbin/route \ @@ -90,20 +83,13 @@ sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-re rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \ $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir}} \ - $RPM_BUILD_ROOT{%{_libdir}/%{name}/plugins,%{systemdtmpfilesdir},%{systemdunitdir}} \ - $RPM_BUILD_ROOT/lib/systemd/system-generators + $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins %{__make} install \ DESTDIR=$RPM_BUILD_ROOT install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} -install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf - -install -p %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system-generators/openvpn-service-generator -install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.target -install -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn@.service -ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.service %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la @@ -113,25 +99,12 @@ rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add openvpn %service openvpn restart "OpenVPN" -%systemd_post openvpn.target %preun if [ "$1" = "0" ]; then %service openvpn stop /sbin/chkconfig --del openvpn fi -%systemd_preun openvpn.target - -%postun -%systemd_reload - -%triggerpostun -- openvpn < 2.3.2-2 -[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm -[ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0 -[ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]openvpn)" = "/etc/rc.d/rc[0-6].d/S[0-9][0-9]openvpn" ] && exit 0 -export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog -/bin/systemctl --quiet enable openvpn.target || : -exit 0 %files %defattr(644,root,root,755) @@ -141,16 +114,11 @@ exit 0 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} %attr(755,root,root) %{_sbindir}/openvpn %attr(754,root,root) /etc/rc.d/init.d/%{name} -%attr(755,root,root) /lib/systemd/system-generators/%{name}-service-generator -%{systemdunitdir}/%{name}.service -%{systemdunitdir}/%{name}.target -%{systemdunitdir}/%{name}@.service %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugins %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so %{_mandir}/man8/openvpn.8* %dir /var/run/openvpn -/usr/lib/tmpfiles.d/%{name}.conf %files devel %defattr(644,root,root,755) diff --git a/openvpn.target b/openvpn.target deleted file mode 100644 index 652626e..0000000 --- a/openvpn.target +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Start openvpn tunnels -After=network.target -Wants=network.target - -[Install] -WantedBy=multi-user.target diff --git a/openvpn.tmpfiles b/openvpn.tmpfiles deleted file mode 100644 index 4a3dc4a..0000000 --- a/openvpn.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -d /var/run/openvpn 0755 root root - diff --git a/openvpn.upstart b/openvpn.upstart deleted file mode 100644 index 13abace..0000000 --- a/openvpn.upstart +++ /dev/null @@ -1,33 +0,0 @@ -description "Start the OpenVPN tunnels" - -start on pld.network-started -stop on pld.network-stopped - -task -console output - -script - [ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn - - for tun in $TUNNELS; do - if [ ! -f "/etc/openvpn/$tun.conf" ]; then - # skip invalid tunnels - continue - fi - - initctl start openvpn-tunnel TUNNEL=$tun >/dev/null || : - done -end script - -pre-stop script - [ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn - - for tun in $TUNNELS; do - if [ ! -f "/etc/openvpn/$tun.conf" ]; then - # skip invalid tunnels - continue - fi - - initctl stop openvpn-tunnel TUNNEL=$tun >/dev/null || : - done -end script diff --git a/openvpn@.service b/openvpn@.service deleted file mode 100644 index 4a2db14..0000000 --- a/openvpn@.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=OpenVPN tunnel on %I -Requires=openvpn.target -After=openvpn.target -PropagateReloadFrom=openvpn.target - -[Service] -Type=forking -PrivateTmp=true -EnvironmentFile=-/etc/sysconfig/openvpn -PIDFile=/var/run/openvpn/%i.pid -ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --config /etc/openvpn/%i.conf --cd /etc/openvpn $OPENVPN_OPT -ExecReload=/bin/kill -HUP $MAINPID - -[Install] -WantedBy=openvpn.target -- 2.46.0