Package: openvpn
Version: 2.4.0-6+deb9u1
Hi Alberto!
I just discovered a problem/bug in openvpn (installed on a fresh
Debian 9 system).
After the package has been installed, I have to manually run 'systemctl
daemon-reload', or the service will silently fail to start.
History / how to reproduce:
I install Debian 9 and uncheck everything to get a minimal install.
I run 'apt-get install openvpn'
I install my certificates and openvpn.conf.
I try to start the service. Nothing happens.
I tried 'systemctl stop openvpn' followed by 'systemctl start openvpn'.
Nothing happens.
Nothing is logged under /var/log/
In journalctl I see:
Apr 17 11:18:59 foobar systemd[1]: Stopped OpenVPN service.
Apr 17 11:19:07 foobar systemd[1]: Starting OpenVPN service...
Apr 17 11:19:07 foobar systemd[1]: Started OpenVPN service.
Looks good, but no openvpn process is started!
Silent fail. :-(
# systemctl status openvpn
● openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset:
enabled)
Active: active (exited) since Wed 2019-04-17 11:19:07 CEST; 13min ago
Process: 443 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 443 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/openvpn.service
(the same thing (nothing) happens if I use '/etc/init.d/openvpn start')
# ps fax | grep openvpn
No process found.
But if I manually run '/usr/sbin/openvpn --config
/etc/openvpn/openvpn.conf', everything is working just fine.
So the problem is not with openvpn itself, but with systemd/init.
After a reboot, sometimes it starts working, probably because something
executed a 'systemctl daemon-reload'. However, on a minimal install of
Debian 9, with only openvpn installed, even a reboot don't fix the
problem. I have to manually issue the daemon-reload command.
So...
I think the solution is for you to add the command 'systemctl
daemon-reload' to openvpn.postinst.
You already have it in openvpn.postrm, so you can copy the code from
there.
/Martin