2

systemctl stop openvpn@server && systemctl disable openvpn@server.service

After running these commands server sould be disabled and prevented from starting in next boot ?

when I reboot status is this :

openvpn@server.service - OpenVPN connection to server
   Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled;vendor preset: enabled)         
   Active: active (running) since ma 2018-05-21 10:44:57 EEST; 49s ago

So it is running after stopping and disabling after reboot . I just got openvpn 2.4 disable working on virtual machine with its own new innovations with systemd just to find 2.3 does not work as I expected .

Might be that I have misunderstood something , any advice appreciated.

1

There are a lot of reasons a systemd service could be triggered, including dependencies that are hard to track down. systemctl disable only stops it from being associated with units that are declared as requires, wants, requiredby etc. It does not disable the unit from starting entirely.

To hard disable the service from starting, create a symbolic link to /dev/null in /etc/systemd/system with the name fo the instance you want to disable.

ln -s /dev/null /etc/systemd/system/openvpn@server.service
  • 1
    Thanks for saving me from more wasted time . I'll try to add some solution in a script I'm working with . Disable does not work in 2.3 so redirecting it to /dev/null or moving server.conf to other location instead of trying to "disable" service seems to be only reasonable solution . – p.la May 22 '18 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.