[arch-commits] Commit in openvpn/repos (10 files)

Sébastien Luttringer seblu at archlinux.org
Thu Oct 22 14:45:33 UTC 2015


    Date: Thursday, October 22, 2015 @ 16:45:33
  Author: seblu
Revision: 249650

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  openvpn/repos/testing-i686/
  openvpn/repos/testing-i686/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch
    (from rev 249649, openvpn/trunk/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch)
  openvpn/repos/testing-i686/PKGBUILD
    (from rev 249649, openvpn/trunk/PKGBUILD)
  openvpn/repos/testing-i686/openvpn.install
    (from rev 249649, openvpn/trunk/openvpn.install)
  openvpn/repos/testing-i686/openvpn at .service
    (from rev 249649, openvpn/trunk/openvpn at .service)
  openvpn/repos/testing-x86_64/
  openvpn/repos/testing-x86_64/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch
    (from rev 249649, openvpn/trunk/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch)
  openvpn/repos/testing-x86_64/PKGBUILD
    (from rev 249649, openvpn/trunk/PKGBUILD)
  openvpn/repos/testing-x86_64/openvpn.install
    (from rev 249649, openvpn/trunk/openvpn.install)
  openvpn/repos/testing-x86_64/openvpn at .service
    (from rev 249649, openvpn/trunk/openvpn at .service)

--------------------------------------------------------------------------------+
 testing-i686/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch   |   88 ++++++++++
 testing-i686/PKGBUILD                                                          |   56 ++++++
 testing-i686/openvpn.install                                                   |    8 
 testing-i686/openvpn at .service                                                  |   10 +
 testing-x86_64/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch |   88 ++++++++++
 testing-x86_64/PKGBUILD                                                        |   56 ++++++
 testing-x86_64/openvpn.install                                                 |    8 
 testing-x86_64/openvpn at .service                                                |   10 +
 8 files changed, 324 insertions(+)

Copied: openvpn/repos/testing-i686/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch (from rev 249649, openvpn/trunk/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch)
===================================================================
--- testing-i686/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch	                        (rev 0)
+++ testing-i686/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,88 @@
+From 62b1b34a1230885a37e6108d1c988aff56350c2c Mon Sep 17 00:00:00 2001
+From: David Sommerseth <davids at redhat.com>
+Date: Tue, 13 Oct 2015 11:57:59 +0200
+Subject: [PATCH] Fix systemd errors when openvpn is started when there is no
+ tty available
+
+It was discovered that starting openvpn during boot on systemd enabled
+systems after commit b131c7b974d9d4d did not work as expected.  This is
+due to that there is no tty available at that point.
+
+This patch adds an extra check considering if systemd is available or not.
+
+Trac: #618
+Reported-by: Ismail Donmez <idonmez at suse.com>
+Signed-off-by: David Sommerseth <davids at redhat.com>
+---
+ src/openvpn/console.c | 11 +++++++----
+ src/openvpn/console.h |  3 +++
+ src/openvpn/misc.c    |  2 +-
+ 3 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/openvpn/console.c b/src/openvpn/console.c
+index d66d408..b0fa417 100644
+--- a/src/openvpn/console.c
++++ b/src/openvpn/console.c
+@@ -138,15 +138,14 @@ close_tty (FILE *fp)
+ 
+ #endif
+ 
+-#ifdef ENABLE_SYSTEMD
+-
+ /*
+  * is systemd running
+  */
+ 
+-static bool
++bool
+ check_systemd_running ()
+ {
++#ifdef ENABLE_SYSTEMD
+   struct stat c;
+ 
+   /* We simply test whether the systemd cgroup hierarchy is
+@@ -155,9 +154,13 @@ check_systemd_running ()
+ 
+   return (sd_booted() > 0)
+ 	  && (stat(SYSTEMD_ASK_PASSWORD_PATH, &c) == 0);
+-
++#else
++  return false;
++#endif
+ }
+ 
++#ifdef ENABLE_SYSTEMD
++
+ static bool
+ get_console_input_systemd (const char *prompt, const bool echo, char *input, const int capacity)
+ {
+diff --git a/src/openvpn/console.h b/src/openvpn/console.h
+index 268f3fe..e29dd2e 100644
+--- a/src/openvpn/console.h
++++ b/src/openvpn/console.h
+@@ -28,6 +28,9 @@
+ #include "basic.h"
+ 
+ bool
++check_systemd_running ();
++
++bool
+ get_console_input (const char *prompt, const bool echo, char *input, const int capacity);
+ 
+ #endif
+diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
+index fd1930a..6c85677 100644
+--- a/src/openvpn/misc.c
++++ b/src/openvpn/misc.c
+@@ -1058,7 +1058,7 @@ get_user_pass_cr (struct user_pass *up,
+ 	{
+ #ifndef WIN32
+ 	  /* did we --daemon'ize before asking for passwords? */
+-	  if ( !isatty(0) && !isatty(2) )
++	  if ( !isatty(0) && !isatty(2) && !check_systemd_running() )
+ 	    { msg(M_FATAL, "neither stdin nor stderr are a tty device, can't ask for %s password.  If you used --daemon, you need to use --askpass to make passphrase-protected keys work, and you can not use --auth-nocache.", prefix ); }
+ #endif
+ 
+-- 
+1.8.3.1
+

Copied: openvpn/repos/testing-i686/PKGBUILD (from rev 249649, openvpn/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,56 @@
+# $Id$
+# Maintainer: Thomas Bächler <thomas at archlinux.org>
+
+pkgname=openvpn
+pkgver=2.3.8
+pkgrel=2
+pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)"
+arch=(i686 x86_64)
+url="http://openvpn.net/index.php/open-source.html"
+depends=('openssl' 'lzo' 'iproute2' 'libsystemd')
+makedepends=('systemd')
+license=('custom')
+install=openvpn.install
+source=(http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz
+        http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz.asc
+		0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch
+        openvpn at .service)
+sha256sums=('532435eff61c14b44a583f27b72f93e7864e96c95fe51134ec0ad4b1b1107c51'
+            'SKIP'
+            'a03a22de7cb3bd9ece7ccb041283d4bd17eb898a9e3fe76d0fd1e20fb80a59f3'
+            '860976d954bd1db95861b95f0ef42e4e80618aa23a9f2aed26d17ee3d09110df')
+validpgpkeys=('03300E11FED16F59715F9996C29D97ED198D22A3')  # Samuli Seppänen
+
+prepare() {
+	patch -p 1 -d $pkgname-$pkgver < 0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch
+}
+
+build() {
+  cd "${srcdir}"/$pkgname-$pkgver
+  CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure \
+    --prefix=/usr \
+    --sbindir=/usr/bin \
+    --enable-password-save \
+    --mandir=/usr/share/man \
+    --enable-iproute2 \
+    --enable-systemd
+  make
+}
+
+package() {
+  cd "${srcdir}"/$pkgname-$pkgver
+  # Install openvpn
+  make DESTDIR="${pkgdir}" install
+  install -d -m755 "${pkgdir}"/etc/openvpn
+  # Install examples
+  install -d -m755 "${pkgdir}"/usr/share/openvpn
+  cp -r sample/sample-config-files "${pkgdir}"/usr/share/openvpn/examples
+  # Install license
+  install -d -m755 "${pkgdir}"/usr/share/licenses/${pkgname}/
+  ln -sf /usr/share/doc/${pkgname}/{COPYING,COPYRIGHT.GPL} "${pkgdir}"/usr/share/licenses/${pkgname}/
+  # Install contrib
+  install -d -m755 "${pkgdir}"/usr/share/openvpn/contrib
+  cp -r contrib "${pkgdir}"/usr/share/openvpn
+  # Install systemd service
+  install -D -m644 "${srcdir}"/openvpn at .service "${pkgdir}"/usr/lib/systemd/system/openvpn at .service
+}

Copied: openvpn/repos/testing-i686/openvpn.install (from rev 249649, openvpn/trunk/openvpn.install)
===================================================================
--- testing-i686/openvpn.install	                        (rev 0)
+++ testing-i686/openvpn.install	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,8 @@
+## arg 1:  the new package version
+## arg 2:  the old package version
+post_upgrade() {
+  if [ $(vercmp 2.3.2-1 $2) -ge 0 ]; then
+    echo ">>> easy-rsa has moved into its own package. Run:"
+    echo ">>>  # pacman -S easy-rsa"
+  fi
+}

Copied: openvpn/repos/testing-i686/openvpn at .service (from rev 249649, openvpn/trunk/openvpn at .service)
===================================================================
--- testing-i686/openvpn at .service	                        (rev 0)
+++ testing-i686/openvpn at .service	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,10 @@
+[Unit]
+Description=OpenVPN connection to %i
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn@%i.pid
+PIDFile=/run/openvpn@%i.pid
+
+[Install]
+WantedBy=multi-user.target

Copied: openvpn/repos/testing-x86_64/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch (from rev 249649, openvpn/trunk/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch)
===================================================================
--- testing-x86_64/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch	                        (rev 0)
+++ testing-x86_64/0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,88 @@
+From 62b1b34a1230885a37e6108d1c988aff56350c2c Mon Sep 17 00:00:00 2001
+From: David Sommerseth <davids at redhat.com>
+Date: Tue, 13 Oct 2015 11:57:59 +0200
+Subject: [PATCH] Fix systemd errors when openvpn is started when there is no
+ tty available
+
+It was discovered that starting openvpn during boot on systemd enabled
+systems after commit b131c7b974d9d4d did not work as expected.  This is
+due to that there is no tty available at that point.
+
+This patch adds an extra check considering if systemd is available or not.
+
+Trac: #618
+Reported-by: Ismail Donmez <idonmez at suse.com>
+Signed-off-by: David Sommerseth <davids at redhat.com>
+---
+ src/openvpn/console.c | 11 +++++++----
+ src/openvpn/console.h |  3 +++
+ src/openvpn/misc.c    |  2 +-
+ 3 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/openvpn/console.c b/src/openvpn/console.c
+index d66d408..b0fa417 100644
+--- a/src/openvpn/console.c
++++ b/src/openvpn/console.c
+@@ -138,15 +138,14 @@ close_tty (FILE *fp)
+ 
+ #endif
+ 
+-#ifdef ENABLE_SYSTEMD
+-
+ /*
+  * is systemd running
+  */
+ 
+-static bool
++bool
+ check_systemd_running ()
+ {
++#ifdef ENABLE_SYSTEMD
+   struct stat c;
+ 
+   /* We simply test whether the systemd cgroup hierarchy is
+@@ -155,9 +154,13 @@ check_systemd_running ()
+ 
+   return (sd_booted() > 0)
+ 	  && (stat(SYSTEMD_ASK_PASSWORD_PATH, &c) == 0);
+-
++#else
++  return false;
++#endif
+ }
+ 
++#ifdef ENABLE_SYSTEMD
++
+ static bool
+ get_console_input_systemd (const char *prompt, const bool echo, char *input, const int capacity)
+ {
+diff --git a/src/openvpn/console.h b/src/openvpn/console.h
+index 268f3fe..e29dd2e 100644
+--- a/src/openvpn/console.h
++++ b/src/openvpn/console.h
+@@ -28,6 +28,9 @@
+ #include "basic.h"
+ 
+ bool
++check_systemd_running ();
++
++bool
+ get_console_input (const char *prompt, const bool echo, char *input, const int capacity);
+ 
+ #endif
+diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
+index fd1930a..6c85677 100644
+--- a/src/openvpn/misc.c
++++ b/src/openvpn/misc.c
+@@ -1058,7 +1058,7 @@ get_user_pass_cr (struct user_pass *up,
+ 	{
+ #ifndef WIN32
+ 	  /* did we --daemon'ize before asking for passwords? */
+-	  if ( !isatty(0) && !isatty(2) )
++	  if ( !isatty(0) && !isatty(2) && !check_systemd_running() )
+ 	    { msg(M_FATAL, "neither stdin nor stderr are a tty device, can't ask for %s password.  If you used --daemon, you need to use --askpass to make passphrase-protected keys work, and you can not use --auth-nocache.", prefix ); }
+ #endif
+ 
+-- 
+1.8.3.1
+

Copied: openvpn/repos/testing-x86_64/PKGBUILD (from rev 249649, openvpn/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,56 @@
+# $Id$
+# Maintainer: Thomas Bächler <thomas at archlinux.org>
+
+pkgname=openvpn
+pkgver=2.3.8
+pkgrel=2
+pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)"
+arch=(i686 x86_64)
+url="http://openvpn.net/index.php/open-source.html"
+depends=('openssl' 'lzo' 'iproute2' 'libsystemd')
+makedepends=('systemd')
+license=('custom')
+install=openvpn.install
+source=(http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz
+        http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz.asc
+		0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch
+        openvpn at .service)
+sha256sums=('532435eff61c14b44a583f27b72f93e7864e96c95fe51134ec0ad4b1b1107c51'
+            'SKIP'
+            'a03a22de7cb3bd9ece7ccb041283d4bd17eb898a9e3fe76d0fd1e20fb80a59f3'
+            '860976d954bd1db95861b95f0ef42e4e80618aa23a9f2aed26d17ee3d09110df')
+validpgpkeys=('03300E11FED16F59715F9996C29D97ED198D22A3')  # Samuli Seppänen
+
+prepare() {
+	patch -p 1 -d $pkgname-$pkgver < 0001-Fix-systemd-errors-when-openvpn-is-started-when-ther.patch
+}
+
+build() {
+  cd "${srcdir}"/$pkgname-$pkgver
+  CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure \
+    --prefix=/usr \
+    --sbindir=/usr/bin \
+    --enable-password-save \
+    --mandir=/usr/share/man \
+    --enable-iproute2 \
+    --enable-systemd
+  make
+}
+
+package() {
+  cd "${srcdir}"/$pkgname-$pkgver
+  # Install openvpn
+  make DESTDIR="${pkgdir}" install
+  install -d -m755 "${pkgdir}"/etc/openvpn
+  # Install examples
+  install -d -m755 "${pkgdir}"/usr/share/openvpn
+  cp -r sample/sample-config-files "${pkgdir}"/usr/share/openvpn/examples
+  # Install license
+  install -d -m755 "${pkgdir}"/usr/share/licenses/${pkgname}/
+  ln -sf /usr/share/doc/${pkgname}/{COPYING,COPYRIGHT.GPL} "${pkgdir}"/usr/share/licenses/${pkgname}/
+  # Install contrib
+  install -d -m755 "${pkgdir}"/usr/share/openvpn/contrib
+  cp -r contrib "${pkgdir}"/usr/share/openvpn
+  # Install systemd service
+  install -D -m644 "${srcdir}"/openvpn at .service "${pkgdir}"/usr/lib/systemd/system/openvpn at .service
+}

Copied: openvpn/repos/testing-x86_64/openvpn.install (from rev 249649, openvpn/trunk/openvpn.install)
===================================================================
--- testing-x86_64/openvpn.install	                        (rev 0)
+++ testing-x86_64/openvpn.install	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,8 @@
+## arg 1:  the new package version
+## arg 2:  the old package version
+post_upgrade() {
+  if [ $(vercmp 2.3.2-1 $2) -ge 0 ]; then
+    echo ">>> easy-rsa has moved into its own package. Run:"
+    echo ">>>  # pacman -S easy-rsa"
+  fi
+}

Copied: openvpn/repos/testing-x86_64/openvpn at .service (from rev 249649, openvpn/trunk/openvpn at .service)
===================================================================
--- testing-x86_64/openvpn at .service	                        (rev 0)
+++ testing-x86_64/openvpn at .service	2015-10-22 14:45:33 UTC (rev 249650)
@@ -0,0 +1,10 @@
+[Unit]
+Description=OpenVPN connection to %i
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn@%i.pid
+PIDFile=/run/openvpn@%i.pid
+
+[Install]
+WantedBy=multi-user.target



More information about the arch-commits mailing list