From e1d159662ba0d70673c0dffca3203b15f599a601 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:16:10 +0000 Subject: [PATCH 1/9] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 68b6d3f..5e77816 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: vtun -# $Id$ +# $Id: Makefile,v 1.1 2008/11/19 01:43:25 kevin Exp $ NAME := vtun SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 88cba9f252919273fb58452874ac613c2e1168bb Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 May 2010 02:27:52 +0000 Subject: [PATCH 2/9] Initialize branch EL-6 for vtun --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..46381b9 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-6 From 3c0902311c852535b92270ef689d9c6fccd87288 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 15:10:26 +0000 Subject: [PATCH 3/9] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - import.log | 1 - 4 files changed, 23 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 5e77816..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: vtun -# $Id: Makefile,v 1.1 2008/11/19 01:43:25 kevin Exp $ -NAME := vtun -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 46381b9..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-6 diff --git a/import.log b/import.log deleted file mode 100644 index 25326c0..0000000 --- a/import.log +++ /dev/null @@ -1 +0,0 @@ -vtun-3_0_1-3_fc8:HEAD:vtun-3.0.1-3.fc8.src.rpm:1227105889 From db92f70dbf3120b51857d6d1ddbe7fe62bba92ab Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Thu, 6 Jan 2011 16:19:09 -0500 Subject: [PATCH 4/9] add support for systemd (#661331) --- vtun.spec | 23 ++++++++++++++++++++--- vtund.systemd | 10 ++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 vtund.systemd diff --git a/vtun.spec b/vtun.spec index 98fdae6..3b5abb1 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,17 +1,21 @@ Name: vtun Version: 3.0.1 -Release: 7%{?dist} +Release: 9%{?dist} Summary: Virtual tunnel over TCP/IP networks License: GPLv2+ Group: System Environment/Daemons Url: http://vtun.sourceforge.net Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source1: vtund.init +Source2: vtund.systemd BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: xinetd Requires(post): /sbin/chkconfig -Requires(preun): /sbin/service /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): systemd-units Requires(postun): /sbin/service +Requires(postun): systemd-units BuildRequires: zlib-devel lzo-devel openssl-devel bison flex %description @@ -34,6 +38,7 @@ require modification to any kernel parts. %install %{__rm} -rf %{buildroot} %{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}/%{_initrddir}/vtund +%{__install} -D -m 0644 -p %{SOURCE2} %{buildroot}/lib/systemd/system/vtund.service %{__install} -D -m 0644 -p scripts/vtund.xinetd %{buildroot}/%{_sysconfdir}/xinetd.d/vtun %{__sed} -i 's:/usr/local:%{_prefix}:' %{buildroot}/%{_sysconfdir}/xinetd.d/vtun %{__make} install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" @@ -50,11 +55,14 @@ fi if [ $1 -eq 0 ]; then /sbin/service vtund stop >/dev/null 2>&1 || : /sbin/chkconfig --del vtund || : + /bin/systemctl disable vtund.service >/dev/null 2>&1 || : + /bin/systemctl stop vtund.service >/dev/null 2>&1 || : fi %postun if [ $1 -eq 1 ]; then /sbin/service vtund condrestart >/dev/null 2>&1 || : + /bin/systemctl try-restart vtund.service >/dev/null 2>&1 || : fi %files @@ -63,14 +71,21 @@ fi %config(noreplace) %{_sysconfdir}/vtund.conf %config(noreplace) %{_sysconfdir}/xinetd.d/vtun %{_initrddir}/vtund +/lib/systemd/system/vtund.service %{_sbindir}/vtund %dir %{_localstatedir}/log/vtund -%dir %{_localstatedir}/lock/vtund +%ghost %dir %{_localstatedir}/lock/vtund %{_mandir}/man5/vtund.conf.5* %{_mandir}/man8/vtun.8* %{_mandir}/man8/vtund.8* %changelog +* Thu Jan 06 2011 Gabriel Somlo 3.0.1-9 +- add support for systemd (#661331) + +* Tue Nov 30 2010 Gabriel Somlo 3.0.1-8 +- using %ghost on /var/lock/vtund directory (#656720) + * Fri Aug 21 2009 Tomas Mraz - 3.0.1-7 - rebuilt with new openssl @@ -85,7 +100,9 @@ fi * Mon Nov 17 2008 Gabriel Somlo 3.0.1-3 - scriptlets fixes + * Fri Nov 14 2008 Gabriel Somlo 3.0.1-2 - spec file fixes: defattr, -p flag to install program + * Mon Oct 20 2008 Gabriel Somlo 3.0.1-1 - initial fedora package diff --git a/vtund.systemd b/vtund.systemd new file mode 100644 index 0000000..47f7bc8 --- /dev/null +++ b/vtund.systemd @@ -0,0 +1,10 @@ +[Unit] +Description=virtual tunnel daemon +After=syslog.target network.target + +[Service] +Type=forking +ExecStart=/usr/sbin/vtund -s + +[Install] +WantedBy=multi-user.target From 9b6e8e8fc1afe75462379406b4894302bbe5cb36 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Thu, 6 Jan 2011 16:25:51 -0500 Subject: [PATCH 5/9] add support for systemd (#661331) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1b3feab..78cf322 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ vtun-3.0.1.tar.gz +/vtun-3.0.1.tar.gz From 6a7f150c7aa4182ef0b2327cf0863ae23c0360bd Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Wed, 1 May 2013 21:34:18 -0400 Subject: [PATCH 6/9] rebuild with PIE (#955286) --- .gitignore | 1 + sources | 2 +- vtun-nostrip.patch | 10 +++++ vtun.service | 7 +++ vtun.socket | 9 ++++ vtun.spec | 86 ++++++++++++++++++++--------------- vtund.init | 110 --------------------------------------------- vtund.systemd | 10 ----- 8 files changed, 77 insertions(+), 158 deletions(-) create mode 100644 vtun-nostrip.patch create mode 100644 vtun.service create mode 100644 vtun.socket delete mode 100644 vtund.init delete mode 100644 vtund.systemd diff --git a/.gitignore b/.gitignore index 78cf322..f9c375d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vtun-3.0.1.tar.gz /vtun-3.0.1.tar.gz +/vtun-3.0.3.tar.gz diff --git a/sources b/sources index 6c68109..d62f2f2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c342ffe77055d4248a38f0b380f28c1b vtun-3.0.1.tar.gz +f3becf2a0270910a841060c08d1db824 vtun-3.0.3.tar.gz diff --git a/vtun-nostrip.patch b/vtun-nostrip.patch new file mode 100644 index 0000000..fb4aa65 --- /dev/null +++ b/vtun-nostrip.patch @@ -0,0 +1,10 @@ +diff -up vtun-3.0.3/Makefile.in~ vtun-3.0.3/Makefile.in +--- vtun-3.0.3/Makefile.in~ 2012-07-09 07:55:38.000000000 +0300 ++++ vtun-3.0.3/Makefile.in 2012-09-16 16:12:41.176283091 +0300 +@@ -99,6 +99,5 @@ install: vtund install_config install_ma + $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(LOCK_DIR) + $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR) + $(INSTALL) -m 755 $(INSTALL_OWNER) vtund $(DESTDIR)$(SBIN_DIR) +- $(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund + + # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/vtun.service b/vtun.service new file mode 100644 index 0000000..d872e6f --- /dev/null +++ b/vtun.service @@ -0,0 +1,7 @@ +[Unit] +Description=Virtual Tunnels over TCP/IP networks +After=local-fs.target + +[Service] +ExecStart=/usr/sbin/vtund -i +StandardInput=socket diff --git a/vtun.socket b/vtun.socket new file mode 100644 index 0000000..0dd22f9 --- /dev/null +++ b/vtun.socket @@ -0,0 +1,9 @@ +[Unit] +Description=Vtun Activation Socket + +[Socket] +ListenStream=5000 +Accept=true + +[Install] +WantedBy=sockets.target diff --git a/vtun.spec b/vtun.spec index 3b5abb1..a66c301 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,22 +1,22 @@ Name: vtun -Version: 3.0.1 -Release: 9%{?dist} +Version: 3.0.3 +Release: 3%{?dist} Summary: Virtual tunnel over TCP/IP networks License: GPLv2+ Group: System Environment/Daemons Url: http://vtun.sourceforge.net Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -Source1: vtund.init -Source2: vtund.systemd -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: xinetd -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service +Source1: vtun.socket +Source2: vtun.service +Patch0: vtun-nostrip.patch + +Requires(post): systemd-units Requires(preun): systemd-units -Requires(postun): /sbin/service Requires(postun): systemd-units -BuildRequires: zlib-devel lzo-devel openssl-devel bison flex +BuildRequires: zlib-devel lzo-devel openssl-devel bison flex systemd-units + +#enable PIE/PIC: +%global _hardened_build 1 %description VTun provides a method for creating Virtual Tunnels over TCP/IP networks @@ -30,48 +30,32 @@ require modification to any kernel parts. %prep %setup -q +%patch0 -p1 %build %configure -%{__make} %{?_smp_mflags} +make %{?_smp_mflags} %install -%{__rm} -rf %{buildroot} -%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}/%{_initrddir}/vtund -%{__install} -D -m 0644 -p %{SOURCE2} %{buildroot}/lib/systemd/system/vtund.service -%{__install} -D -m 0644 -p scripts/vtund.xinetd %{buildroot}/%{_sysconfdir}/xinetd.d/vtun -%{__sed} -i 's:/usr/local:%{_prefix}:' %{buildroot}/%{_sysconfdir}/xinetd.d/vtun -%{__make} install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" - -%clean -%{__rm} -rf %{buildroot} +install -D -m 0644 -p %{SOURCE1} %{buildroot}/%{_unitdir}/vtun.socket +install -D -m 0644 -p %{SOURCE2} %{buildroot}/%{_unitdir}/vtun.service +make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" %post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add vtund || : -fi +%systemd_post vtun.service vtun.socket %preun -if [ $1 -eq 0 ]; then - /sbin/service vtund stop >/dev/null 2>&1 || : - /sbin/chkconfig --del vtund || : - /bin/systemctl disable vtund.service >/dev/null 2>&1 || : - /bin/systemctl stop vtund.service >/dev/null 2>&1 || : -fi +%systemd_preun vtun.service vtun.socket %postun -if [ $1 -eq 1 ]; then - /sbin/service vtund condrestart >/dev/null 2>&1 || : - /bin/systemctl try-restart vtund.service >/dev/null 2>&1 || : -fi +%systemd_postun vtun.service vtun.socket %files %defattr(-,root,root,-) %doc ChangeLog Credits FAQ README README.LZO README.Setup README.Shaper TODO vtund.conf %config(noreplace) %{_sysconfdir}/vtund.conf -%config(noreplace) %{_sysconfdir}/xinetd.d/vtun -%{_initrddir}/vtund -/lib/systemd/system/vtund.service +%{_unitdir}/vtun.socket +%{_unitdir}/vtun.service %{_sbindir}/vtund %dir %{_localstatedir}/log/vtund %ghost %dir %{_localstatedir}/lock/vtund @@ -80,6 +64,34 @@ fi %{_mandir}/man8/vtund.8* %changelog +* Wed May 01 2013 Gabriel Somlo 3.0.3-3 +- rebuild with PIE (#955286) + +* Sun Sep 16 2012 Gabriel Somlo 3.0.3-2 +- avoid stripping too early to preserve debuginfo (#857716) + +* Thu Sep 13 2012 Gabriel Somlo 3.0.3-1 +- update to 3.0.3 +- new systemd-rpm macros (#850362) + +* Sun Jul 22 2012 Fedora Release Engineering - 3.0.1-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon May 21 2012 Peter Robinson - 3.0.1-14 +- Fix unit file location, cleanup and modernise spec + +* Sat Jan 14 2012 Fedora Release Engineering - 3.0.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Sat Sep 10 2011 Gabriel Somlo 3.0.1-12 +- removed xinetd and sysvinit support + +* Sat Sep 10 2011 Gabriel Somlo 3.0.1-11 +- update support for systemd (#737195) + +* Mon Feb 07 2011 Fedora Release Engineering - 3.0.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Thu Jan 06 2011 Gabriel Somlo 3.0.1-9 - add support for systemd (#661331) diff --git a/vtund.init b/vtund.init deleted file mode 100644 index 13f22bc..0000000 --- a/vtund.init +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# -# vtund Startup script for the virtual tunnel daemon -# -# chkconfig: - 55 45 -# description: Virtual Tunnel Daemon provides the facility to create \ -# virtual tunnels over TCP/IP networks and allows for \ -# shaping, compression, and encryption of tunneled traffic. - -### BEGIN INIT INFO -# Provides: -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: -# Default-Stop: -# Short-Description: -# Description: -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec="/usr/sbin/vtund" -prog="vtund" -config="/etc/vtund.conf" - -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -lockfile=/var/lock/subsys/$prog - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon $exec -s - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading config for $prog: " - killproc $prog -HUP - retval=$? - echo - return $retval -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/vtund.systemd b/vtund.systemd deleted file mode 100644 index 47f7bc8..0000000 --- a/vtund.systemd +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=virtual tunnel daemon -After=syslog.target network.target - -[Service] -Type=forking -ExecStart=/usr/sbin/vtund -s - -[Install] -WantedBy=multi-user.target From d9d88a92e11be5acb33889ec4ea9f914c36ba2e4 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Sat, 15 Nov 2014 23:30:11 -0500 Subject: [PATCH 7/9] added /etc/sysconfig/vtun environment file; updated unit files --- vtun.service | 13 ++++++++++--- vtun.socket | 1 - vtun.spec | 31 +++++++++++++++++++++++++++---- vtun.sysconfig | 16 ++++++++++++++++ 4 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 vtun.sysconfig diff --git a/vtun.service b/vtun.service index d872e6f..edf21da 100644 --- a/vtun.service +++ b/vtun.service @@ -1,7 +1,14 @@ [Unit] Description=Virtual Tunnels over TCP/IP networks -After=local-fs.target +After=syslog.target network.target [Service] -ExecStart=/usr/sbin/vtund -i -StandardInput=socket +Type=forking +EnvironmentFile=/etc/sysconfig/vtun +ExecStart=/usr/sbin/vtund $OPTIONS +ExecReload=/usr/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/vtun.socket b/vtun.socket index 0dd22f9..07f9d3d 100644 --- a/vtun.socket +++ b/vtun.socket @@ -3,7 +3,6 @@ Description=Vtun Activation Socket [Socket] ListenStream=5000 -Accept=true [Install] WantedBy=sockets.target diff --git a/vtun.spec b/vtun.spec index a66c301..38e46ec 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,6 +1,6 @@ Name: vtun Version: 3.0.3 -Release: 3%{?dist} +Release: 9%{?dist} Summary: Virtual tunnel over TCP/IP networks License: GPLv2+ Group: System Environment/Daemons @@ -8,12 +8,13 @@ Url: http://vtun.sourceforge.net Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source1: vtun.socket Source2: vtun.service +Source3: vtun.sysconfig Patch0: vtun-nostrip.patch Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units -BuildRequires: zlib-devel lzo-devel openssl-devel bison flex systemd-units +BuildRequires: zlib-devel lzo-devel openssl-devel bison flex systemd-units autoconf #enable PIE/PIC: %global _hardened_build 1 @@ -33,12 +34,14 @@ require modification to any kernel parts. %patch0 -p1 %build +%{__autoconf} %configure make %{?_smp_mflags} %install install -D -m 0644 -p %{SOURCE1} %{buildroot}/%{_unitdir}/vtun.socket install -D -m 0644 -p %{SOURCE2} %{buildroot}/%{_unitdir}/vtun.service +install -D -m 0644 -p %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/vtun make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" %post @@ -54,6 +57,7 @@ make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" %defattr(-,root,root,-) %doc ChangeLog Credits FAQ README README.LZO README.Setup README.Shaper TODO vtund.conf %config(noreplace) %{_sysconfdir}/vtund.conf +%config(noreplace) %{_sysconfdir}/sysconfig/vtun %{_unitdir}/vtun.socket %{_unitdir}/vtun.service %{_sbindir}/vtund @@ -64,9 +68,28 @@ make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" %{_mandir}/man8/vtund.8* %changelog -* Wed May 01 2013 Gabriel Somlo 3.0.3-3 +* Fri Nov 14 2014 Gabriel Somlo 3.0.3-9 +- added /etc/sysconfig/vtun environment file +- updated unit files + +* Mon Aug 18 2014 Fedora Release Engineering - 3.0.3-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 3.0.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 3.0.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon May 13 2013 Gabriel Somlo 3.0.3-5 +- added autoconf step to support aarch64 (#926708) + +* Wed May 01 2013 Gabriel Somlo 3.0.3-4 - rebuild with PIE (#955286) +* Fri Feb 15 2013 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + * Sun Sep 16 2012 Gabriel Somlo 3.0.3-2 - avoid stripping too early to preserve debuginfo (#857716) @@ -96,7 +119,7 @@ make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" - add support for systemd (#661331) * Tue Nov 30 2010 Gabriel Somlo 3.0.1-8 -- using %ghost on /var/lock/vtund directory (#656720) +- using ghost on /var/lock/vtund directory (#656720) * Fri Aug 21 2009 Tomas Mraz - 3.0.1-7 - rebuilt with new openssl diff --git a/vtun.sysconfig b/vtun.sysconfig new file mode 100644 index 0000000..467bd8b --- /dev/null +++ b/vtun.sysconfig @@ -0,0 +1,16 @@ +# Comment out one of the following for client or server mode +# +# To run vtun as a server: +# +#OPTIONS='-s' +# +# +# +#To run vtun as a client, we need: +# +# - session name, e.g. "lion"; must be present in both client and server +# config files. +# +# - server address or host name. +# +#OPTIONS='lion vtun-server.example.com' From 14ccb2a61b85376f61937e10773ed8cd6f3e6603 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Thu, 20 Nov 2014 17:16:17 -0500 Subject: [PATCH 8/9] enhanced service file (don't daemonize vtund) --- vtun.service | 3 +-- vtun.spec | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vtun.service b/vtun.service index edf21da..a9e6aca 100644 --- a/vtun.service +++ b/vtun.service @@ -3,9 +3,8 @@ Description=Virtual Tunnels over TCP/IP networks After=syslog.target network.target [Service] -Type=forking EnvironmentFile=/etc/sysconfig/vtun -ExecStart=/usr/sbin/vtund $OPTIONS +ExecStart=/usr/sbin/vtund -n $OPTIONS ExecReload=/usr/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure diff --git a/vtun.spec b/vtun.spec index 38e46ec..a091433 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,6 +1,6 @@ Name: vtun Version: 3.0.3 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Virtual tunnel over TCP/IP networks License: GPLv2+ Group: System Environment/Daemons @@ -68,6 +68,9 @@ make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" %{_mandir}/man8/vtund.8* %changelog +* Thu Nov 20 2014 Gabriel Somlo 3.0.3-10 +- enhanced service file (-n to prevent daemonizing vtund) + * Fri Nov 14 2014 Gabriel Somlo 3.0.3-9 - added /etc/sysconfig/vtun environment file - updated unit files From 1aa46b803d4d3bb3a62ed65cfaf89c0999dbba60 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Mon, 21 Mar 2016 17:41:21 -0400 Subject: [PATCH 9/9] patch to fix RHBZ 1319858, 1319861 --- sources | 2 +- vtun-client-sighup.patch | 33 ++++++++++ vtun-nostrip.patch | 10 --- vtun.service | 13 ---- vtun.socket | 8 --- vtun.spec | 130 ++++++++++----------------------------- vtun.sysconfig | 16 ----- vtund.init | 110 +++++++++++++++++++++++++++++++++ 8 files changed, 178 insertions(+), 144 deletions(-) create mode 100644 vtun-client-sighup.patch delete mode 100644 vtun-nostrip.patch delete mode 100644 vtun.service delete mode 100644 vtun.socket delete mode 100644 vtun.sysconfig create mode 100644 vtund.init diff --git a/sources b/sources index d62f2f2..6c68109 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f3becf2a0270910a841060c08d1db824 vtun-3.0.3.tar.gz +c342ffe77055d4248a38f0b380f28c1b vtun-3.0.1.tar.gz diff --git a/vtun-client-sighup.patch b/vtun-client-sighup.patch new file mode 100644 index 0000000..744aeae --- /dev/null +++ b/vtun-client-sighup.patch @@ -0,0 +1,33 @@ +When sending a SIGHUP to a vtun client process which is unable to connect +to the remote server, it will attempt to reconnect without sleeping between +consecutive attempts. This results in a CPU usage spike, and a flood of +data sent to syslog. +This patch causes the first sleep after SIGHUP to be discarded, then allows +sleep to be used again in subsequent iterations. +diff -NarU5 a/client.c b/client.c +--- a/client.c 2006-12-11 02:55:06.000000000 -0500 ++++ b/client.c 2016-03-21 14:41:09.014377581 -0400 +@@ -129,10 +129,11 @@ + vtun_syslog(LOG_INFO,"Connecting to %s", vtun.svr_name); + + if( connect_t(s,(struct sockaddr *) &svr_addr, host->timeout) ){ + vtun_syslog(LOG_INFO,"Connect to %s failed. %s(%d)", vtun.svr_name, + strerror(errno), errno); ++ client_term = 0; + } else { + if( auth_client(s, host) ){ + vtun_syslog(LOG_INFO,"Session %s[%s] opened",host->host,vtun.svr_name); + + host->rmt_fd = s; +@@ -141,10 +142,11 @@ + client_term = tunnel(host); + + vtun_syslog(LOG_INFO,"Session %s[%s] closed",host->host,vtun.svr_name); + } else { + vtun_syslog(LOG_INFO,"Connection denied by %s",vtun.svr_name); ++ client_term = 0; + } + } + close(s); + free_sopt(&host->sopt); + } diff --git a/vtun-nostrip.patch b/vtun-nostrip.patch deleted file mode 100644 index fb4aa65..0000000 --- a/vtun-nostrip.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -up vtun-3.0.3/Makefile.in~ vtun-3.0.3/Makefile.in ---- vtun-3.0.3/Makefile.in~ 2012-07-09 07:55:38.000000000 +0300 -+++ vtun-3.0.3/Makefile.in 2012-09-16 16:12:41.176283091 +0300 -@@ -99,6 +99,5 @@ install: vtund install_config install_ma - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(LOCK_DIR) - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR) - $(INSTALL) -m 755 $(INSTALL_OWNER) vtund $(DESTDIR)$(SBIN_DIR) -- $(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund - - # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/vtun.service b/vtun.service deleted file mode 100644 index a9e6aca..0000000 --- a/vtun.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Virtual Tunnels over TCP/IP networks -After=syslog.target network.target - -[Service] -EnvironmentFile=/etc/sysconfig/vtun -ExecStart=/usr/sbin/vtund -n $OPTIONS -ExecReload=/usr/bin/kill -HUP $MAINPID -KillMode=process -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/vtun.socket b/vtun.socket deleted file mode 100644 index 07f9d3d..0000000 --- a/vtun.socket +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Vtun Activation Socket - -[Socket] -ListenStream=5000 - -[Install] -WantedBy=sockets.target diff --git a/vtun.spec b/vtun.spec index a091433..7cd6b86 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,23 +1,19 @@ Name: vtun -Version: 3.0.3 +Version: 3.0.1 Release: 10%{?dist} Summary: Virtual tunnel over TCP/IP networks License: GPLv2+ Group: System Environment/Daemons Url: http://vtun.sourceforge.net Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -Source1: vtun.socket -Source2: vtun.service -Source3: vtun.sysconfig -Patch0: vtun-nostrip.patch - -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -BuildRequires: zlib-devel lzo-devel openssl-devel bison flex systemd-units autoconf - -#enable PIE/PIC: -%global _hardened_build 1 +Source1: vtund.init +Patch0: vtun-client-sighup.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires: xinetd +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service /sbin/chkconfig +Requires(postun): /sbin/service +BuildRequires: zlib-devel lzo-devel openssl-devel bison flex %description VTun provides a method for creating Virtual Tunnels over TCP/IP networks @@ -34,113 +30,55 @@ require modification to any kernel parts. %patch0 -p1 %build -%{__autoconf} %configure -make %{?_smp_mflags} +%{__make} %{?_smp_mflags} %install -install -D -m 0644 -p %{SOURCE1} %{buildroot}/%{_unitdir}/vtun.socket -install -D -m 0644 -p %{SOURCE2} %{buildroot}/%{_unitdir}/vtun.service -install -D -m 0644 -p %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/vtun -make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" +%{__rm} -rf %{buildroot} +%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}/%{_initrddir}/vtund +%{__install} -D -m 0644 -p scripts/vtund.xinetd %{buildroot}/%{_sysconfdir}/xinetd.d/vtun +%{__sed} -i 's:/usr/local:%{_prefix}:' %{buildroot}/%{_sysconfdir}/xinetd.d/vtun +%{__make} install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" + +%clean +%{__rm} -rf %{buildroot} %post -%systemd_post vtun.service vtun.socket +if [ $1 -eq 1 ]; then + /sbin/chkconfig --add vtund || : +fi %preun -%systemd_preun vtun.service vtun.socket +if [ $1 -eq 0 ]; then + /sbin/service vtund stop >/dev/null 2>&1 || : + /sbin/chkconfig --del vtund || : +fi %postun -%systemd_postun vtun.service vtun.socket +if [ $1 -eq 1 ]; then + /sbin/service vtund condrestart >/dev/null 2>&1 || : +fi %files %defattr(-,root,root,-) %doc ChangeLog Credits FAQ README README.LZO README.Setup README.Shaper TODO vtund.conf %config(noreplace) %{_sysconfdir}/vtund.conf -%config(noreplace) %{_sysconfdir}/sysconfig/vtun -%{_unitdir}/vtun.socket -%{_unitdir}/vtun.service +%config(noreplace) %{_sysconfdir}/xinetd.d/vtun +%{_initrddir}/vtund %{_sbindir}/vtund %dir %{_localstatedir}/log/vtund -%ghost %dir %{_localstatedir}/lock/vtund +%dir %{_localstatedir}/lock/vtund %{_mandir}/man5/vtund.conf.5* %{_mandir}/man8/vtun.8* %{_mandir}/man8/vtund.8* %changelog -* Thu Nov 20 2014 Gabriel Somlo 3.0.3-10 -- enhanced service file (-n to prevent daemonizing vtund) - -* Fri Nov 14 2014 Gabriel Somlo 3.0.3-9 -- added /etc/sysconfig/vtun environment file -- updated unit files - -* Mon Aug 18 2014 Fedora Release Engineering - 3.0.3-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sun Jun 08 2014 Fedora Release Engineering - 3.0.3-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Aug 04 2013 Fedora Release Engineering - 3.0.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Mon May 13 2013 Gabriel Somlo 3.0.3-5 -- added autoconf step to support aarch64 (#926708) - -* Wed May 01 2013 Gabriel Somlo 3.0.3-4 -- rebuild with PIE (#955286) - -* Fri Feb 15 2013 Fedora Release Engineering -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Sun Sep 16 2012 Gabriel Somlo 3.0.3-2 -- avoid stripping too early to preserve debuginfo (#857716) - -* Thu Sep 13 2012 Gabriel Somlo 3.0.3-1 -- update to 3.0.3 -- new systemd-rpm macros (#850362) - -* Sun Jul 22 2012 Fedora Release Engineering - 3.0.1-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Mon May 21 2012 Peter Robinson - 3.0.1-14 -- Fix unit file location, cleanup and modernise spec - -* Sat Jan 14 2012 Fedora Release Engineering - 3.0.1-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Sat Sep 10 2011 Gabriel Somlo 3.0.1-12 -- removed xinetd and sysvinit support - -* Sat Sep 10 2011 Gabriel Somlo 3.0.1-11 -- update support for systemd (#737195) - -* Mon Feb 07 2011 Fedora Release Engineering - 3.0.1-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Thu Jan 06 2011 Gabriel Somlo 3.0.1-9 -- add support for systemd (#661331) - -* Tue Nov 30 2010 Gabriel Somlo 3.0.1-8 -- using ghost on /var/lock/vtund directory (#656720) - -* Fri Aug 21 2009 Tomas Mraz - 3.0.1-7 -- rebuilt with new openssl - -* Sun Jul 26 2009 Fedora Release Engineering - 3.0.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Wed Feb 25 2009 Fedora Release Engineering - 3.0.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Sun Jan 18 2009 Tomas Mraz 3.0.1-4 -- rebuild with new openssl - +* Mon Mar 21 2016 Gabriel Somlo 3.0.1-10 +- patch to fix RHBZ 1319858, 1319860 +- bump release past (el6 & Fedora specific) attempts to add systemd support * Mon Nov 17 2008 Gabriel Somlo 3.0.1-3 - scriptlets fixes - * Fri Nov 14 2008 Gabriel Somlo 3.0.1-2 - spec file fixes: defattr, -p flag to install program - * Mon Oct 20 2008 Gabriel Somlo 3.0.1-1 - initial fedora package diff --git a/vtun.sysconfig b/vtun.sysconfig deleted file mode 100644 index 467bd8b..0000000 --- a/vtun.sysconfig +++ /dev/null @@ -1,16 +0,0 @@ -# Comment out one of the following for client or server mode -# -# To run vtun as a server: -# -#OPTIONS='-s' -# -# -# -#To run vtun as a client, we need: -# -# - session name, e.g. "lion"; must be present in both client and server -# config files. -# -# - server address or host name. -# -#OPTIONS='lion vtun-server.example.com' diff --git a/vtund.init b/vtund.init new file mode 100644 index 0000000..13f22bc --- /dev/null +++ b/vtund.init @@ -0,0 +1,110 @@ +#!/bin/sh +# +# vtund Startup script for the virtual tunnel daemon +# +# chkconfig: - 55 45 +# description: Virtual Tunnel Daemon provides the facility to create \ +# virtual tunnels over TCP/IP networks and allows for \ +# shaping, compression, and encryption of tunneled traffic. + +### BEGIN INIT INFO +# Provides: +# Required-Start: +# Required-Stop: +# Should-Start: +# Should-Stop: +# Default-Start: +# Default-Stop: +# Short-Description: +# Description: +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +exec="/usr/sbin/vtund" +prog="vtund" +config="/etc/vtund.conf" + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog + +start() { + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 + echo -n $"Starting $prog: " + daemon $exec -s + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading config for $prog: " + killproc $prog -HUP + retval=$? + echo + return $retval +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + + +case "$1" in + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $?