You are not logged in.
Hi,
I've written a small systemd service file which simply start a socks5 tunneling proxy with ssh. Everything is working fine when I launch the service "by hand" with a "systemctl start".
However, when I install the service, ssh fail to start because net-auto-wired/wireless didn't have the time to completely launch dhcpcd (no binding yet), even after having added an "After=net-auto-wired.service".
Has someone a clue of what I should do to achieve my goal ?
Thanks
Offline
unfortunately no, it is not enough... BTW, I have the same problem with nmdb.service which is failing because it starts too early. For the tunnel stuff maybe I can use netcfg quirks, but it looks like kind of hack...
Offline
Offline
I have already tried, "nss-lookup.target" and "nss-user-lookup.target" but nothing changed, ssh is still started long before dhclient finish its job of acauiring an ip adress/dns. I have an ipv6 network, but it shouldn't change anything. BTW how can I delay network.target (as it is precisely what should be done) until I get a correct ip ? Let's hope google will help..
Anyway, thanks fro the answer ;-)
Offline
Maybe change your ssh tunnel service to call a script that will monitor for an ip on the interface, and when found then starts the ssh tunnel:
You can get the IP address on the interface like this:
ip addr show eth0 | grep inet | awk '{print $2}' | head -1Just wrap that in a loop that waits for an ip, and then starts the ssh tunnel:
while [ -z "$(ip addr show eth0 | grep inet | awk '{print $2}' | head -1)" ]
do
sleep 5
done
ssh blah blah blahOf course replace "eth0" with whatever your interface name is.
Offline
Yes it basically works now.
Thanks
Offline