Skip to contentSkip to conversation

Ubuntu 18.04 packages available for testing

Openvpn-devel Samuli Seppänen 4 participants 11 messages Dec 27, 2018 – Jan 4, 2019

lore
Share & tools
lore
#0 lore raw

Hi,

I've produced OpenVPN 2.4.6 packages for Ubuntu 18.04 and they're now available here:

https://build.openvpn.net/downloads/temp/

The Debian packaging files are taken from Ubuntu's own 18.04 openvpn package. They already used our [email protected]... and [email protected]... so I only need to make a few enhancements:

- Restart active VPN client and server instances on upgrade
- Stop activate VPN client and server instances on uninstall

I also tested upgrading from Ubuntu's own openvpn package and that worked fine.

Let me know if these packages work for you or if they don't. I'd like to get the to our official apt repositories soon.

Also, if you can, please review these PRs which enable anyone to build the Ubuntu/Debian packages, including ones for Ubuntu 18.04:

https://github.com/OpenVPN/sbuild_wrapper/pull/1
https://github.com/OpenVPN/openvpn-vagrant/pull/6

Samuli

#1 lore raw

Hi,

Quoted 11 lines · Samuli Seppänen

Hi,

I've produced OpenVPN 2.4.6 packages for Ubuntu 18.04 and they're now available here:

https://build.openvpn.net/downloads/temp/

The Debian packaging files are taken from Ubuntu's own 18.04 openvpn package. They already used our [email protected]... and [email protected]... so I only need to make a few enhancements:

Quoted 9 lines

- Restart active VPN client and server instances on upgrade
- Stop activate VPN client and server instances on uninstall

I also tested upgrading from Ubuntu's own openvpn package and that worked fine.

Let me know if these packages work for you or if they don't. I'd like to get the to our official apt repositories soon.

Successfully installed openvpn_2.4.6-bionic0_amd64.deb in Ubuntu 18.04, tested newly installed [email protected]... which worked correctly.

Quoted 6 lines

Also, if you can, please review these PRs which enable anyone to build the Ubuntu/Debian packages, including ones for Ubuntu 18.04:

https://github.com/OpenVPN/sbuild_wrapper/pull/1
https://github.com/OpenVPN/openvpn-vagrant/pull/6

Working on it ..

Quoted 9 lines

Samuli

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#2 lore raw
Quoted 5 lines · tincanteksup

Hi,

Quoted 1 line · Samuli Seppänen
Quoted 9 lines
Quoted 6 lines

Also, if you can, please review these PRs which enable anyone to build the Ubuntu/Debian packages, including ones for Ubuntu 18.04:

https://github.com/OpenVPN/sbuild_wrapper/pull/1
https://github.com/OpenVPN/openvpn-vagrant/pull/6

Working on it ..

Tested and working but with one note.

scripts/prepare-all.sh

```
dpkg-buildpackage -d -S -uc -us
```

does not work.

The failure is:

```
[email protected]...:~/openvpn/pkg-bsys$ sudo scripts/prepare-all.sh
--2018-12-29 16:04:53-- http://build.openvpn.net/downloads/releases/openvpn-2.4.6.tar.gz
Resolving build.openvpn.net (build.openvpn.net)... 52.52.118.245, 2600:1f1c:702:ae00:f27c:d805:3b80:a45d
Connecting to build.openvpn.net (build.openvpn.net)|52.52.118.245|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1431971 (1.4M) [application/octet-stream]
Saving to: ‘openvpn-2.4.6.tar.gz’

openvpn-2.4.6.tar.gz 100%[========================================================================>] 
  1.37M   159KB/s    in 7.4s

2018-12-29 16:05:00 (190 KB/s) - ‘openvpn-2.4.6.tar.gz’ saved [1431971/1431971]

cp: 'debian/patches/series' and 'debian/patches/series' are the same file
dpkg-buildpackage: info: source package openvpn
dpkg-buildpackage: info: source version 2.4.6-bionic0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Samuli Seppänen <[email protected]...>
 dpkg-source --before-build openvpn-2.4.6
dpkg-source: info: applying move_log_dir.patch
dpkg-source: info: applying auth-pam_libpam_so_filename.patch
dpkg-source: info: applying debian_nogroup_for_sample_files.patch
dpkg-source: info: applying openvpn-pkcs11warn.patch
dpkg-source: info: applying kfreebsd_support.patch
dpkg-source: info: applying match-manpage-and-command-help.patch
 debian/rules clean
dh clean
make: dh: Command not found
debian/rules:16: recipe for target 'clean' failed
make: *** [clean] Error 127
dpkg-buildpackage: error: debian/rules clean subprocess returned exit status 2

```

Change scripts/prepare-all.sh

```
dpkg-buildpackage -nc -d -S -uc -us
```

Works, tested on two independent systems.

The output is now:

```
[email protected]...:~/openvpn/pkg-bsys$ sudo scripts/prepare-all.sh
--2018-12-29 19:25:52-- http://build.openvpn.net/downloads/releases/openvpn-2.4.6.tar.gz
Resolving build.openvpn.net (build.openvpn.net)... 52.52.118.245, 2600:1f1c:702:ae00:f27c:d805:3b80:a45d
Connecting to build.openvpn.net (build.openvpn.net)|52.52.118.245|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1431971 (1.4M) [application/octet-stream]
Saving to: ‘openvpn-2.4.6.tar.gz’

openvpn-2.4.6.tar.gz 100%[========================================================================>] 
  1.37M   308KB/s    in 5.0s

2018-12-29 19:25:57 (282 KB/s) - ‘openvpn-2.4.6.tar.gz’ saved [1431971/1431971]

cp: 'debian/patches/series' and 'debian/patches/series' are the same file
dpkg-buildpackage: info: source package openvpn
dpkg-buildpackage: info: source version 2.4.6-bionic0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Samuli Seppänen <[email protected]...>
 dpkg-source --before-build openvpn-2.4.6
dpkg-source: info: applying move_log_dir.patch
dpkg-source: info: applying auth-pam_libpam_so_filename.patch
dpkg-source: info: applying debian_nogroup_for_sample_files.patch
dpkg-source: info: applying openvpn-pkcs11warn.patch
dpkg-source: info: applying kfreebsd_support.patch
dpkg-source: info: applying match-manpage-and-command-help.patch
dpkg-buildpackage: warning: building a source package without cleaning up as you asked; it might contain undesired files
 dpkg-source -b openvpn-2.4.6
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building openvpn using existing ./openvpn_2.4.6.orig.tar.gz
dpkg-source: info: building openvpn in openvpn_2.4.6-bionic0.debian.tar.xz
dpkg-source: info: building openvpn in openvpn_2.4.6-bionic0.dsc
 dpkg-genbuildinfo --build=source
 dpkg-genchanges --build=source >../openvpn_2.4.6-bionic0_source.changes
dpkg-genchanges: info: including full source code in upload
 dpkg-source --after-build openvpn-2.4.6
dpkg-source: info: unapplying match-manpage-and-command-help.patch
dpkg-source: info: unapplying kfreebsd_support.patch
dpkg-source: info: unapplying openvpn-pkcs11warn.patch
dpkg-source: info: unapplying debian_nogroup_for_sample_files.patch
dpkg-source: info: unapplying auth-pam_libpam_so_filename.patch
dpkg-source: info: unapplying move_log_dir.patch
dpkg-buildpackage: info: full upload (original source is included)

```
#3 lore raw

Hi,

Il 29/12/18 22:06, tincanteksup ha scritto:

Quoted 46 lines · tincanteksup
Quoted 5 lines

Hi,

Quoted 1 line · Samuli Seppänen
Quoted 9 lines
Quoted 6 lines

Also, if you can, please review these PRs which enable anyone to build the Ubuntu/Debian packages, including ones for Ubuntu 18.04:

https://github.com/OpenVPN/sbuild_wrapper/pull/1
https://github.com/OpenVPN/openvpn-vagrant/pull/6

Working on it ..

Tested and working but with one note.

scripts/prepare-all.sh

```
dpkg-buildpackage -d -S -uc -us
```

does not work.

The failure is:
```

[email protected]...:~/openvpn/pkg-bsys$ sudo scripts/prepare-all.sh
--2018-12-29 16:04:53--
http://build.openvpn.net/downloads/releases/openvpn-2.4.6.tar.gz
Resolving build.openvpn.net (build.openvpn.net)... 52.52.118.245,
2600:1f1c:702:ae00:f27c:d805:3b80:a45d
Connecting to build.openvpn.net (build.openvpn.net)|52.52.118.245|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 1431971 (1.4M) [application/octet-stream]
Saving to: ‘openvpn-2.4.6.tar.gz’

openvpn-2.4.6.tar.gz 100%[========================================================================>] 1.37M   159KB/s    in 7.4s

2018-12-29 16:05:00 (190 KB/s) - ‘openvpn-2.4.6.tar.gz’ saved

[1431971/1431971]

Quoted 16 lines

cp: 'debian/patches/series' and 'debian/patches/series' are the same file
dpkg-buildpackage: info: source package openvpn
dpkg-buildpackage: info: source version 2.4.6-bionic0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Samuli Seppänen <[email protected]...>
 dpkg-source --before-build openvpn-2.4.6
dpkg-source: info: applying move_log_dir.patch
dpkg-source: info: applying auth-pam_libpam_so_filename.patch
dpkg-source: info: applying debian_nogroup_for_sample_files.patch
dpkg-source: info: applying openvpn-pkcs11warn.patch
dpkg-source: info: applying kfreebsd_support.patch
dpkg-source: info: applying match-manpage-and-command-help.patch debian/rules clean
dh clean
make: dh: Command not found

Package "debhelper" is missing. When using Vagrant debhelper gets installed in the provisioning script:

https://github.com/mattock/openvpn-vagrant/blob/sbuild/sbuild.sh

That provisioning script should run fine on any Ubuntu 18.04 VM, not just inside Vagrant/Virtualbox.

Quoted 74 lines

debian/rules:16: recipe for target 'clean' failed
make: *** [clean] Error 127
dpkg-buildpackage: error: debian/rules clean subprocess returned exit status 2

```

Change scripts/prepare-all.sh
```
dpkg-buildpackage -nc -d -S -uc -us
```
Works, tested on two independent systems.

The output is now:
```
[email protected]...:~/openvpn/pkg-bsys$ sudo scripts/prepare-all.sh
--2018-12-29 19:25:52--
http://build.openvpn.net/downloads/releases/openvpn-2.4.6.tar.gz
Resolving build.openvpn.net (build.openvpn.net)... 52.52.118.245,
2600:1f1c:702:ae00:f27c:d805:3b80:a45d
Connecting to build.openvpn.net (build.openvpn.net)|52.52.118.245|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 1431971 (1.4M) [application/octet-stream]
Saving to: ‘openvpn-2.4.6.tar.gz’

openvpn-2.4.6.tar.gz 100%[========================================================================>] 1.37M   308KB/s    in 5.0s

2018-12-29 19:25:57 (282 KB/s) - ‘openvpn-2.4.6.tar.gz’ saved

[1431971/1431971]

cp: 'debian/patches/series' and 'debian/patches/series' are the same file
dpkg-buildpackage: info: source package openvpn
dpkg-buildpackage: info: source version 2.4.6-bionic0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Samuli Seppänen <[email protected]...>
 dpkg-source --before-build openvpn-2.4.6
dpkg-source: info: applying move_log_dir.patch
dpkg-source: info: applying auth-pam_libpam_so_filename.patch
dpkg-source: info: applying debian_nogroup_for_sample_files.patch
dpkg-source: info: applying openvpn-pkcs11warn.patch
dpkg-source: info: applying kfreebsd_support.patch
dpkg-source: info: applying match-manpage-and-command-help.patch
dpkg-buildpackage: warning: building a source package without cleaning up as you asked; it might contain undesired files
 dpkg-source -b openvpn-2.4.6
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building openvpn using existing ./openvpn_2.4.6.orig.tar.gz
dpkg-source: info: building openvpn in openvpn_2.4.6-bionic0.debian.tar.xz
dpkg-source: info: building openvpn in openvpn_2.4.6-bionic0.dsc dpkg-genbuildinfo --build=source
 dpkg-genchanges --build=source >../openvpn_2.4.6-bionic0_source.changes
dpkg-genchanges: info: including full source code in upload dpkg-source --after-build openvpn-2.4.6
dpkg-source: info: unapplying match-manpage-and-command-help.patch
dpkg-source: info: unapplying kfreebsd_support.patch
dpkg-source: info: unapplying openvpn-pkcs11warn.patch
dpkg-source: info: unapplying debian_nogroup_for_sample_files.patch
dpkg-source: info: unapplying auth-pam_libpam_so_filename.patch
dpkg-source: info: unapplying move_log_dir.patch
dpkg-buildpackage: info: full upload (original source is included)

```

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#4 lore raw

Hi,

Quoted 9 lines · Samuli Seppänen

Hi,

Il 29/12/18 22:06, tincanteksup ha scritto:

Quoted 5 lines

 debian/rules clean
dh clean
make: dh: Command not found

Quoted 7 lines

Package "debhelper" is missing. When using Vagrant debhelper gets installed in the provisioning script:

https://github.com/mattock/openvpn-vagrant/blob/sbuild/sbuild.sh

That provisioning script should run fine on any Ubuntu 18.04 VM, not just inside Vagrant/Virtualbox.

Yes, it all works now.

#5 lore raw
In reply to tincanteksup

Il 28/12/18 16:21, tincanteksup ha scritto:

Quoted 20 lines

Hi,

Quoted 17 lines · Samuli Seppänen

Hi,

I've produced OpenVPN 2.4.6 packages for Ubuntu 18.04 and they're now available here:

https://build.openvpn.net/downloads/temp/

The Debian packaging files are taken from Ubuntu's own 18.04 openvpn package. They already used our [email protected]... and [email protected]... so I only need to make a few enhancements:

- Restart active VPN client and server instances on upgrade
- Stop activate VPN client and server instances on uninstall

I also tested upgrading from Ubuntu's own openvpn package and that worked fine.

Quoted 6 lines
Quoted 3 lines

Let me know if these packages work for you or if they don't. I'd like to get the to our official apt repositories soon.

Successfully installed openvpn_2.4.6-bionic0_amd64.deb in Ubuntu 18.04, tested newly installed [email protected]... which worked correctly.

Excellent! The openvpn-client@ and openvpn-server@ unit file templates "sneak in" to the Debian package from our upstream tarball. When looking at the Debian packaging files there's absolutely no sign of them. But they get installed and seem to work, including the tmpfiles configuration.

Quoted 10 lines
Quoted 7 lines

Also, if you can, please review these PRs which enable anyone to build the Ubuntu/Debian packages, including ones for Ubuntu 18.04:

https://github.com/OpenVPN/sbuild_wrapper/pull/1
https://github.com/OpenVPN/openvpn-vagrant/pull/6

Working on it ..

Samuli

#6 lore raw
Quoted 25 lines · Samuli Seppänen

Il 28/12/18 16:21, tincanteksup ha scritto:

Quoted 24 lines

Hi,

Quoted 20 lines · Samuli Seppänen

Hi,

I've produced OpenVPN 2.4.6 packages for Ubuntu 18.04 and they're now available here:

https://build.openvpn.net/downloads/temp/

The Debian packaging files are taken from Ubuntu's own 18.04 openvpn package. They already used our [email protected]... and [email protected]... so I only need to make a few enhancements:

- Restart active VPN client and server instances on upgrade
- Stop activate VPN client and server instances on uninstall

I also tested upgrading from Ubuntu's own openvpn package and that worked fine.

Let me know if these packages work for you or if they don't. I'd like to get the to our official apt repositories soon.

Quoted 7 lines
Quoted 2 lines

Successfully installed openvpn_2.4.6-bionic0_amd64.deb in Ubuntu 18.04, tested newly installed [email protected]... which worked correctly.

Excellent! The openvpn-client@ and openvpn-server@ unit file templates "sneak in" to the Debian package from our upstream tarball. When looking at the Debian packaging files there's absolutely no sign of them. But they get installed and seem to work, including the tmpfiles configuration.

Those new service files are the ones everyone should use. In our own packaging, we should abandon the b0rken unit files from the old-days Debian packages. This is especially true for OpenVPN 2.4+ when built with --enable-systemd (which should be mandatory on systemd systems!). The reason is that it uses much better systemd integration which allows systemd to understand better what openvpn is doing and when it fails. Plus, the openvpn process is being run with lesser privileges as well and for openvpn-server@ it will even attempt to restart automatically the server instance if it dies unexpectedly.

And IIRC, we managed to get the new unit files into the Debian openvpn 2.4 package. And I just hope that they are updated with whatever we provide in our tarballs; if not - it might be considered broken packaging. The reason you'll find the b0rken unit files in the upstream Debian packages is to not break old existing installs. Which is nice, just that it behaves broken regardless.

So if anyone is in doubt ... UPGRADE to the openvpn-{server,client}@.service unit files ASAP.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#7 lore raw

Hi,

Il 31/12/18 01:08, David Sommerseth ha scritto:

Quoted 33 lines · Samuli Seppänen
Quoted 25 lines

Il 28/12/18 16:21, tincanteksup ha scritto:

Quoted 24 lines

Hi,

Quoted 20 lines · Samuli Seppänen

Hi,

I've produced OpenVPN 2.4.6 packages for Ubuntu 18.04 and they're now available here:

https://build.openvpn.net/downloads/temp/

The Debian packaging files are taken from Ubuntu's own 18.04 openvpn package. They already used our [email protected]... and [email protected]... so I only need to make a few enhancements:

- Restart active VPN client and server instances on upgrade
- Stop activate VPN client and server instances on uninstall

I also tested upgrading from Ubuntu's own openvpn package and that worked fine.

Let me know if these packages work for you or if they don't. I'd like to get the to our official apt repositories soon.

Quoted 7 lines
Quoted 2 lines

Successfully installed openvpn_2.4.6-bionic0_amd64.deb in Ubuntu 18.04, tested newly installed [email protected]... which worked correctly.

Excellent! The openvpn-client@ and openvpn-server@ unit file templates "sneak in" to the Debian package from our upstream tarball. When looking at the Debian packaging files there's absolutely no sign of them. But they get installed and seem to work, including the tmpfiles configuration.

Quoted 15 lines

Those new service files are the ones everyone should use. In our own packaging, we should abandon the b0rken unit files from the old-days Debian packages. This is especially true for OpenVPN 2.4+ when built with --enable-systemd (which should be mandatory on systemd systems!). The reason is that it uses much better systemd integration which allows systemd to understand better what openvpn is doing and when it fails. Plus, the openvpn process is being run with lesser privileges as well and for openvpn-server@ it will even attempt to restart automatically the server instance if it dies unexpectedly.
And IIRC, we managed to get the new unit files into the Debian openvpn 2.4 package. And I just hope that they are updated with whatever we provide in our tarballs; if not - it might be considered broken packaging. The reason you'll find the b0rken unit files in the upstream Debian packages is to not break old existing installs. Which is nice, just that it behaves broken regardless.

And this is exactly the reason I did _not_ remove openvpn.service or [email protected]... from our Ubuntu 18.04 packages.

Quoted 3 lines

So if anyone is in doubt ... UPGRADE to the openvpn-{server,client}@.service unit files ASAP.

I'll mention this in the README.Debian. I added a short "notes from upstream" section there anyways.

Do you have links to bug reports that would clarify why the old unit files are broken? If I'm not mistaken one of the issues was related to OpenVPN on Amazon EC2 and status check #2 not passing when an instance of [email protected]... was running.

Samuli

#8 lore raw
Quoted 3 lines · Samuli Seppänen

Hi,

Il 31/12/18 01:08, David Sommerseth ha scritto:

[...snip...]

Quoted 9 lines
Quoted 6 lines

And IIRC, we managed to get the new unit files into the Debian openvpn 2.4 package. And I just hope that they are updated with whatever we provide in our tarballs; if not - it might be considered broken packaging. The reason you'll find the b0rken unit files in the upstream Debian packages is to not break old existing installs. Which is nice, just that it behaves broken regardless.

And this is exactly the reason I did _not_ remove openvpn.service or [email protected]... from our Ubuntu 18.04 packages.

Okay, I was a bit unclear. The approach used with openvpn.service and [email protected]... are broken by (Debian) design. Quite many users have reported that these service files does not work at all. But I'll admit, I'm not really up-to-date if these service files have been updated by distro-packagers later on.

It would be far better to pop up a README file at install/update time saying "These unit files are gone, use the new ones instead." The reason is that _our_ packages are different than Debian's packages, so they shouldn't need to try to duplicate the Debian packages in every detail.

Secondly, if OpenVPN is built with systemd support there are a few other surprises some users have reported to me, when not using the unit files which makes use of the openvpn<->systemd interface in the C code. We even do some intercepts related to the --daemon if systemd is detected, where it is effectively ignoring --daemon (as that is not needed with the new systemd files). My memory is blurry here, though.

The alternative is to provide an alternative to [email protected]..., which does not add all the client and server specific hardening, automatic restarts, etc, etc, but ensures the openvpn<->systemd interface is intact.

But for the openvpn.service, there is no alternative to killing it. It's an odd approach where it, IIRC, generates new unit files on-the-fly for specific openvpn configs and then starts them. I have some vague memories that it would even overwrite existing unit files. It is just generally a horrendous approach, which tries to make the unit (ini) file behave like the old rc init shell script. It feels list it tries to build a space rocket out of a trolley; I'm not saying it's impossible, it's just not pretty and might even be quite unsafe in many aspects. Some times it is needed to draw a line and
say: From here we do it differently.

Quoted 11 lines
Quoted 3 lines

So if anyone is in doubt ... UPGRADE to the openvpn-{server,client}@.service unit files ASAP.

I'll mention this in the README.Debian. I added a short "notes from upstream" section there anyways.

Do you have links to bug reports that would clarify why the old unit files are broken? If I'm not mistaken one of the issues was related to OpenVPN on Amazon EC2 and status check #2 not passing when an instance of [email protected]... was running.

That's one of the issues. I've gotten several reports since the v2.4 release, covering all kind of scenarios as well, the vast majority of those issues disappeared when switching to our new ones. I have discussed this many times on IRC, I know there existed some issues both in Trac and elsewhere - but right now I don't have a good list of them handy.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#9 lore raw

Am 04.01.19 um 17:25 schrieb David Sommerseth:

Hi everyone,

Quoted 5 lines

Okay, I was a bit unclear. The approach used with openvpn.service and [email protected]... are broken by (Debian) design. Quite many users have reported that these service files does not work at all. But I'll admit, I'm not really up-to-date if these service files have been updated by distro-packagers later on.

(One of the) Debian OpenVPN maintainer here. I'd like to get some input about the perceived brokenness of the [email protected]... in Debian. Freeze is coming up, but we still have time to fix issues if they arise. I'm not aware of any major bugs reported for this.

First of all, we ship both [email protected]... (which is maintained in Debian) and [email protected]... and [email protected]... from the upstream sources. As a user of our package you are very much free (and encouraged) to work with OpenVPN in the officially documented way.

[email protected]... mostly comes from a compatibility layer. Since years in Debian you could drop a .conf into /etc/openvpn and had it executed at startup (controlled by a variable in /etc/default/openvpn). This is pretty much remodeled by the use of a custom generator, see
https://sources.debian.org/src/openvpn/2.4.6-1/debian/openvpn-generator/
. openvpn.service just binds these instances together to allow for a service openvpn restart to work. And I currently don't see a compelling reason to drop this, since it allows upgrading users to keep working).

Since the .conf files are not split between client and server we have to use one [email protected]... that can accomodate both. But I really fail to see the problem here. [email protected]... and [email protected]... are not that much different. We do use systemd readyness notification, the capability bounding set is the same (for server), the ExecStart line is similar, we do restart on error.

[email protected]... ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf --writepid /run/openvpn/%i.pid

[email protected]...
ExecStart=/usr/sbin/openvpn --status %t/openvpn-server/status-%i.log --status-version 2 --suppress-timestamps --config %i.conf

-client.service is a bit more restricted and uses --nobind and no status file, but that's about it.

Bernhard

#10 lore raw
Quoted 15 lines · Bernhard Schmidt

Am 04.01.19 um 17:25 schrieb David Sommerseth:

Hi everyone,

Quoted 5 lines

Okay, I was a bit unclear. The approach used with openvpn.service and [email protected]... are broken by (Debian) design. Quite many users have reported that these service files does not work at all. But I'll admit, I'm not really up-to-date if these service files have been updated by distro-packagers later on.

(One of the) Debian OpenVPN maintainer here. I'd like to get some input about the perceived brokenness of the [email protected]... in Debian. Freeze is coming up, but we still have time to fix issues if they arise. I'm not aware of any major bugs reported for this.

Quoted 4 lines

First of all, we ship both [email protected]... (which is maintained in Debian) and [email protected]... and [email protected]... from the upstream sources. As a user of our package you are very much free (and encouraged) to work with OpenVPN in the officially documented way.

That's really good! Thank you, Bernhard!

Quoted 8 lines

[email protected]... mostly comes from a compatibility layer. Since years in Debian you could drop a .conf into /etc/openvpn and had it executed at startup (controlled by a variable in /etc/default/openvpn). This is pretty much remodeled by the use of a custom generator, see
https://sources.debian.org/src/openvpn/2.4.6-1/debian/openvpn-generator/
. openvpn.service just binds these instances together to allow for a service openvpn restart to work. And I currently don't see a compelling reason to drop this, since it allows upgrading users to keep working).

I have no strong opinions about what the best approach for the official Debian packages is, from pure a Debian perspective (my responses to Samuli has been the .deb packaging we place into our own repositories).

I do know that this generator has been quite unreliable and a lot of users got confused in the past and several users did 'systemctl start openvpn.service' ... and no OpenVPN services did start while the configuration files was to be found in /etc/openvpn and users did claim this worked earlier. Switching to the new unit files, and everything worked instantly. Another challenge has been that it has been hard to find the proper location where log entries ends up. Too many users don't realise that openvpn.service is something very different from [email protected]...

Quoted 4 lines

Since the .conf files are not split between client and server we have to use one [email protected]... that can accomodate both. But I really fail to see the problem here. [email protected]... and [email protected]... are not that much different.

We move slowly forward in regards to hardening both services. And the server operational mode has more privileges than the client mode. Currently probably not the biggest issue, but this is something we will need to work further on.

Quoted 2 lines

We do use systemd readyness notification, the
capability bounding set is the same (for server),

That's good! That has been one of the major pain points.

Quoted 1 line

the ExecStart line is similar, we do restart on error.

Restart on error is reasonable and good in server mode. For client mode, for some that is the proper thing to do; while for others it can be annoying. Hence we have only added restart-on-error for the server mode.

We generally recommend users to do 'systemctl edit [email protected]....' to add restart-on-error for those configurations where it is wanted.

Quoted 4 lines

[email protected]... ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf --writepid /run/openvpn/%i.pid

--daemon is definitaly a NOOP if Type=notify, so that can go out. --writepid is really questionable to me. With Type=notify, systemd should not care about any PID files at all.

There is an outstanding issue with our LimitNPROC= setting. That might need to be increased on the server side, but I don't think we've really found a reasonable default. For client side, it will typically allow 5-10 simultaneously running tunnels, so it might not be hit too hard. The challenge is that LimitNPROC is set on a user account level, it's not a per-process setting.

But I see you don't have --supress-timestamps ... how does the log entries in the log files look like? Don't you get duplicated timestamps per line?

Quoted 6 lines

[email protected]...
ExecStart=/usr/sbin/openvpn --status %t/openvpn-server/status-%i.log --status-version 2 --suppress-timestamps --config %i.conf

-client.service is a bit more restricted and uses --nobind and no status file, but that's about it.

Yes, currently. And I would like to restrict it even further, but the script hooks are really tricky to tackle correctly as it is now. We've tightened the OpenVPN 3 Linux client quite well, and I'd like to see some of those approaches reimplemented in OpenVPN 2 as well.

We are now also in a state with OpenVPN 3 Linux that we can start playing with re-using the openvpn3-service-netcfg D-Bus interface in OpenVPN 2, which will allow the openvpn process to run completely unprivileged. The netcfg service has potential to become a kind of a more generic VPN API for Linux. But for OpenVPN 2.x, the tricky detail is, once again, script hooks - too many scripts expects to have root privileges. That said, the netcfg service will also handle DNS configuration in addition to IP address and routing configuration, so part of the root access requirement on the client side is probably less crucial.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc