0

I'm testing openvpn to restart if it fails for whatever reason.

I edited the file /lib/systemd/system/openvpn.service (with vi straight, just in case) and set the Type to simple, added Restart=always and RestartSec=60. Then ran systemctl daemon-reload and then started my openvpn service (systemctl start openvpn@blahconfig.service) which makes it start. Then I forcefully kill openvpn process with kill and it remains as dead, no intent to restart it.

What should I try next?

1

You are confusing two files:

/lib/systemd/system/openvpn.service
/lib/systemd/system/openvpn@.service

The first is the "service" file that you edited. The second is the "template unit" file that was actually invoked when you started your service.

Second, you are editing files in /lib which are intended to be read-only and may be overwritten by an upgrade.

You should use the Drop-in Unit pattern to override just the changes you need, storing files under /etc/systemd/system instead.

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.