0

I would like to start a specific service after another one has completely started. Specifically, I need an OpenVPN service to be up and have completed its startup to start another service.

I would normally use After= but it does not work as intended with OpenVPN, which informs that it has started right after launch and before its setup is completed.

A solution to this would be to constrain the start of my service to the output or exit status of a script(*) (or to the existence of a file which would be crated by the said script).

Is this possible with systemd?


(*) The script would ping a host known to be accessible only via the VPN tunnel and exit once connectivity is achieved (or drop a file)

WoJ
  • 1,545

1 Answers1

0

You can configure the service unit with

Type=notify
NotifyAccess=all

and make the last script (or a child of that) which is started by OpenVPN during initialization (wait for the desired logging output and then) call systemd-notify.

Hauke Laging
  • 90,279