Ok - I did as described in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792653
Copied the openvpn@.service file from /lib/systemd/system to /etc/systemd/system
I was not able to open it as described with
systemctl stop openvpn@nh.service
with this error:
No files found for openenvpn@.service.
Run 'systemctl edit --force openenvpn@.service' to create a new unit.
So I used nano to edit the file in /etc/systemd/system - this is the result:
[Unit]
Description=OpenVPN connection to %i
PartOf=openvpn.service
ReloadPropagatedFrom=openvpn.service
Before=systemd-user-sessions.service
After=syslog.target network-online.target
Wants=network-online.target
Documentation=man:openvpn(8)
Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO
[Service]
Type=notify
PrivateTmp=true
WorkingDirectory=/etc/openvpn
ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --script$
PIDFile=/run/openvpn/%i.pid
ExecReload=/bin/kill -HUP $MAINPID
CapabilityBoundingSet=
LimitNPROC=10
DeviceAllow=/dev/null rw
DeviceAllow=/dev/net/tun rw
ProtectSystem=true
ProtectHome=true
[Install]
WantedBy=multi-user.target
systemctl enable openvpn@b.service
systemctl start openvpn@b.service
actually works - at least in conf with hashed-out
#up "/usr/bin/sudo /networkfolder/vpn_up.sh"
systemctl list-unit-files --type=service
shows
openvpn-client@.service disabled
openvpn-server@.service disabled
openvpn.service enabled
openvpn@.service enabled
Everything works if I do not want to start the vpn_up.sh (where I deleted the sudo):
#!/bin/bash
service smbd start
/networkfolder/pushover.sh "Share online" "Share online" "chrome" "QUIET"
As soon as I do that, I get the same error as before:
Tue Oct 24 20:58:22 2017 /usr/bin/sudo /networkfolder/vpn_up.sh tunVPN 1500 1553 172.21.90.35 255.255.254.0 init
sudo: unable to send audit message
sudo: pam_open_session: System error
sudo: policy plugin failed session initialization
Tue Oct 24 20:58:22 2017 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Tue Oct 24 20:58:22 2017 Exiting due to fatal error
By the way: thank you so much for helping me!