[systemd-devel] Starting up service after my openvpn connection turns up
Andrei Borzenkov
arvidjaar at gmail.com
Mon Jun 1 20:37:53 PDT 2015
В Mon, 1 Jun 2015 16:36:38 -0400
Matthew Karas <mkarascybi at gmail.com> пишет:
> I am trying to start a dropbear service after my openvpn service starts up.
>
> -----------------------------------
> [Unit]
> Description=SSH Per-Connection Server
> Wants=dropbearkey.service
> After=syslog.target dropbearkey.service
> Wants=openvpn at equipment.service
> After=openvpn at equipment.service
> -----------------------------------
>
>
> But I would like to start up the service after "tun0" interface is
> available (made by openvpn).
>
> How do I find out what to put in "Wants" and "After" for tun0? I
> can't seem to find anything related
>
> Also if there is a better way to get dropbear to start after tun0 has
> appeared I'm open to doing that as well. My goal is to have my ssh
> server only look at my openvpn address and ignore ssh requests that
> are not from the vpn iface. I'm thinking I can do this with a script
> setting up drop bear with the -p option (and looking for my tun0 ip4
> address and using it).
>
What about using OpenVPN hooks to start service after connection is
established? You can pass it (service) interface name and bind it to
interface so it is automatically stopped when interface is teared down.
More information about the systemd-devel
mailing list