How to restart openvpn service (or any service) running under "nobody" user?

Try this, I've noticed that restart doesn't work for me.

sudo systemctl stop openvpn@server
sudo systemctl enable [email protected]
sudo systemctl start openvpn@server

OpenVPN is a templatized service under systemd. The services are named openvpn@config.service. So you should restart your /etc/openvpn/myvpn.conf instance with:

systemctl restart openvpn@myvpn.service

Go to the this directory and take a look at files:

sudo su

cd /etc/systemd/system/multi-user.target.wants

ls

there should be a file in this format (could be different depend on openvpn version):

[email protected]

or

[email protected]

if you see multiple files in this format, it's because you probably use this code before:

sudo systemctl enable [email protected]

this self-made files (created by enable) does nothing and could be removed later. But for now you should find the one works well with this commands without causing any error:

sudo systemctl stop <[email protected]>
sudo systemctl start <[email protected]> 

and replace with all files in this format (starts with openvpn and ends with .service) in the directory. The one that truly stops and starts openvpn service is the file you need and others could be removed (you shouldn't have made them in first place by enabling them):

sudo rm <[email protected]>

Be careful to not to remove the one that is making the service start and stop