Just started using systemd and need to stop and start OpenVPN.
I can successfully start OpenVPN with this for example:
systemctl start openvpn@vpn1.service
and can stop it with:
systemctl stop openvpn@vpn1.service
However I'd like to be able to stop openvpn within a script without having to know which VPN is currently connected. Previously I would use:
service stop openvpn
Is this possible using systemctl?
systemctl stop openvpn.service
doesn't work?openvpn.service
. The question names the units that do exist. Welcome to the concept of template units. Template units are how people use OpenVPN with systemd.