SHA256
1
0
forked from pool/openvpn

Accepting request 175267 from network:vpn

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/175267
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/openvpn?expand=0&rev=47
This commit is contained in:
Stephan Kulow 2013-05-16 09:18:49 +00:00 committed by Git OBS Bridge
commit 4f4f794599
2 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 6 11:13:49 UTC 2013 - mt@suse.de
- Try to migrate openvpn.service autostart to openvpn@<CONF>.service
instance enablement.
-------------------------------------------------------------------
Tue Apr 23 13:20:48 UTC 2013 - mt@suse.de

View File

@ -178,6 +178,40 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/{OpenVPN,%name}
%__mkdir_p -m750 %{_localstatedir}/run/openvpn
%if %{with_systemd}
%service_add_post %{name}.target
# try to migrate openvpn.service autostart to openvpn@<CONF>.service
if test ${FIRST_ARG:-$1} -ge 1 -a \
-x /bin/systemctl -a \
-f /etc/sysconfig/openvpn -a \
-f /var/adm/fillup-templates/sysconfig.openvpn && \
/bin/systemctl --quiet is-enabled openvpn.service &>/dev/null ;
then
. /etc/sysconfig/openvpn
try_service_cgroup_join()
{
local p="/var/run/openvpn/${1}.pid"
local t="/sys/fs/cgroup/systemd/system/openvpn@.service/${1}"
/sbin/checkproc -p "$p" "%{_sbindir}/openvpn" &>/dev/null || return 0
test -d "$t" || mkdir -p "$t" 2>/dev/null || return 1
cat "$p" > "$t/tasks" 2>/dev/null || return 1
}
if test "X$OPENVPN_AUTOSTART" != "X" ; then
for conf in $OPENVPN_AUTOSTART ; do
test -f "/etc/openvpn/${conf}.conf" && \
/bin/systemctl enable "openvpn@${conf}.service" && \
try_service_cgroup_join "$conf" || continue
done
else
shopt -s nullglob || :
for conf in /etc/openvpn/*.conf ; do
conf=${conf##*/}
conf=${conf%.conf}
test -f "/etc/openvpn/${conf}.conf" && \
/bin/systemctl enable "openvpn@${conf}.service" && \
try_service_cgroup_join "$conf" || continue
done
fi
fi
rm -f /etc/sysconfig/openvpn || :
%else
%{?fillup_and_insserv:%fillup_and_insserv}
%endif