Haguichi does not wait for the network to go up before trying to connect

Bug #588903 reported by Saša Tomić on 2010-06-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Haguichi
Fix Released
Medium
Stephen Brandt

Bug Description

Hi,
First of all, I have to say that I reaaaaally like the GUI.
There is one comment on my side and one solution.

I've put haguichi to start automatically with machine and to login automatically. I've put tuncfg into sudoers file so that it does not ask me for the password - this solved one big problem with starting hamachi for the first time since last startup.

There is one problem with haguichi - it does autostart, but it tries to connect even though the wireless connection is not yet established. The time to establish the connection varies, so it wouldn't work to delay the starting of haguichi.

So I've changed the script in this way:
$cat /usr/local/bin/haguichi
-------
#!/bin/sh

while [ `ip r | grep default -c` -lt 1 ]; do
  echo "No internet gateway, sleeping 1 second"
  sleep 1
done

exec mono "/usr/local/lib/haguichi/Haguichi.exe" "$@"
-------

It works for me, but please consider waiting for the internet connection to go up before trying to login with hamachi.
This would be the proper solution.

Thank you,
Sasha

Eduardo Parra (soker) on 2010-06-03
Changed in haguichi:
status: New → Confirmed
Stephen Brandt (ztefn) wrote :

Hi Sasha,

Thanks for reporting this problem.

To solve this issue I'll probably try to incorporate a connection check in Haguichi's overall status check, because a lost internet connection for example can make Haguichi wait in vain for a response from Hamachi.

Changed in haguichi:
importance: Undecided → Medium
assignee: nobody → Stephen Brandt (ztefn)
Stephen Brandt (ztefn) on 2010-06-03
Changed in haguichi:
status: Confirmed → Triaged
Stephen Brandt (ztefn) on 2010-06-13
Changed in haguichi:
status: Triaged → Fix Committed
Stephen Brandt (ztefn) on 2010-06-13
Changed in haguichi:
milestone: none → 0.9.1
Saša Tomić (tomic80) wrote :

Hi Stephen,
I haven't checked the functionality in 0.9.1, but maybe it would be useful for you to check out this hamachi-keepalive wrapper written in bash:
http://computarz.blogspot.com/2010/06/hamachi-vpn-watchdog-keepalive-for.html

It works just great for me!

Maybe you could re-implement in haguichi the functionality provided by the script, if you don't have it all already. Please ask me if you don't understand some part of the wrapper code.
As hamachi connection is quite sensitive, all parts of the script are necessary to make hamachi just a tiny bit more stable.

Sasha

Stephen Brandt (ztefn) wrote :

I have already implemented that, if the connection is lost, Haguichi will reconnect automatically as soon as internet is available (again).

It would be nice if you could test drive the code. You can get it from bazaar with this command: bzr branch lp:haguichi
And then open the solution (Haguichi.sln) file in MonoDevelop.

Saša Tomić (tomic80) wrote :

Brilliant! It seems to work just right! :D
Just one more tiny tiny thing on my side...
would it be possible not to pop-up the haguichi window then the internet connection is lost and there is "Connect Automatically" checked?
Please... :D

Stephen Brandt (ztefn) wrote :

You don't mean at startup? Because for that you can check "Start Haguichi minimized in the notification area" (see: http://www.haguichi.net/wp-content/uploads/preferences_desktop.png).

Saša Tomić (tomic80) wrote :

No, I meant when the internet connection breaks. You can try for yourself - keep it minimized and disconnect internet. Haguichi should pop-up, and then when internet connection is restored, it reconnects and the window stays shown.

I have checked in my config:
"Connect automatically on startup"
"Disconnect on quit"
"Ask confirmation before running tuncfg"
"Start Haguichi in the notification area"
"Start Haguichi minimized..."

Stephen Brandt (ztefn) wrote :

Thanks, I found out there was some misplaced code in the main window's mode switch. It's fixed now.

I have also made reconnecting on connection loss optional with a new checkbox labeled "Automatically reconnecting when connection is lost".

Saša Tomić (tomic80) wrote :

Great!!!!
I tested it and it works magnificently!!!
Thank you sooo much!
It's now officially the one and only hamachi GUI that I can use (i.e. implements all the things that I need).

Stephen Brandt (ztefn) wrote :

Good to hear! I've changed the codename for this release to "Magnificient". :D

Saša Tomić (tomic80) wrote :

Thanks once again for your GREAT work! :D

Stephen Brandt (ztefn) on 2010-06-19
Changed in haguichi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers