support alternate install location of ip command

Bug #743827 reported by H.Gökhan Sarı
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tunnel Manager
Fix Released
Medium
Brandon Williams

Bug Description

I am using openbox as stand-alone wm and tint2 as panel. I built tunnelmanager from bzr today and when I run tunnelmanager i get an tray item without any icon.

I don't know if it is relevant but i get this output: http://pastebin.com/zcG4yR2w

BTW, when I right click on the empty tray icon, it functions OK and I can manage my tunnels. Looks like only problem is there is no tray icon.

I'm adding screenshot.

Revision history for this message
H.Gökhan Sarı (th0th) wrote :
Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

What Linux distribution are you using? The traceback appears to be complaining about a call to /bin/ip, which should be present on any Linux distribution. I've only run the program on Ubuntu, where I know that it works.

You could make the traceback go away by disabling "Load Keys on Startup" and "Save/Restore Tunnel State". You will have to click the "Load Keys" button if your keys aren't already loaded in your ssh-agent, but then, it appears from the output that you don't have an ssh-agent running either. The "Load Keys on Startup" functionality expects you to be able to run ssh-add.

If the above doesn't help to work around the problem, then maybe it's an issue with the icon set you're using. Please let attach a listing of all the icons in the icon set. The program assumes that all of the standard ones will be present.

Changed in tunnelmanager:
status: New → Incomplete
Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

The traceback that you're seeing is indeed associated with not having access to the "ip" utility from within "/bin". On Ubuntu, this utility is installed as "/bin/ip", but there is also a symlink under "/sbin". If your distro installs this utility under "/sbin" and does not also provide access to it from "/bin", then you'll see the traceback in question. If you have "/sbin/ip", then edit Controller.py and change all uses of "/bin/ip" to "/sbin/ip" to resolve the traceback.

Fixing the traceback won't fix the status tray icon, though, since the problem with the status tray icon is probably due to a missing icon in your gtk icon theme. The stock network icon is named "gtk-network.*".

Please try this:

1. execute python from the command line

2. at the python ">>> " prompt, execute the python command "import gtk" (without the quotes)

3. at the python ">>> " prompt, execute "icon = gtk.status_icon_new_from_stock(gtk.STOCK_NETWORK)"

After #3, do you see an icon in the status bar? Your icon theme should have an icon available for all stock icons. If it does not, then it will not be able to display an icon in the status tray. If I rename the icon files so that I don't have files with the expected names, then the command in #3 results in "GtkWarning: Error loading theme icon 'gtk-network' for stock: Error opening file: No such file or directory". If this is what you see, then the missing status tray icon is a bug in your icon theme and should be fixed there.

Revision history for this message
H.Gökhan Sarı (th0th) wrote :

I am using Arch Linux.

$ which ip
/usr/sbin/ip

looks like ubuntu and arch linux have different locations for 'ip' executable. I am not a python expert but isn't there a way to look for 'ip' in $PATH, not in a specific directory?

And about tray icon... I am using faenza icon theme and I went back to 'gnome-icon-theme' to test if it is a issue related to my icon theme and yes, when i switch to gnome-icon-theme the tray icon loads correctly.

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

I'm not inclined to rely on the user's PATH being set up correctly for system utilities. Many users will not have the sbin directories in their path. That said, it should be possible for me to handle this at install time, though it's not something that I've had a reason to learn how to do in python. I'll look into it.

To use a non standard icon theme, you should attempt to identify any stock gtk icons that are missing from the icon theme and add the necessary icons to your $HOME/.icons directory tree.

summary: - No tray icon is displayed
+ support alternate install location of ip command
Changed in tunnelmanager:
status: Incomplete → Confirmed
importance: Undecided → Medium
assignee: nobody → Brandon Williams (opensource-subakutty)
Changed in tunnelmanager:
status: Confirmed → Fix Committed
Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

I submitted the first pass at a fix as revision 65. What this change does is allows the location of the ip command to be reconfigured via the user's ~/.TunnelManager/properties.conf file. With the tunnelmanager _not_ running, open ~/.TunnelManager/properties.conf and add the following lines at the end of the file:

<blank line>
[BASE]
ipcmdpath = /usr/sbin/ip

Save and close and then start tunnelmanager. You should no longer see the trace from /usr/lib/python2.7/subprocess.py.

Provided that this works, then I will think some more about how to handle this better at install.

Revision history for this message
H.Gökhan Sarı (th0th) wrote :

After rebuilding from bzr and updating configuration file as you suggested the trace has gone. Thanks a lot.

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

I've finally pushed new versions to both the downloads list of tunnelmanager (0.7.4) and to my PPA. I will declare the fix released, although I still want to try to figure out a way to handle this automatically at install with the need to either expose the setting in the config GUI or require a manual config change to a hidden setting.

That said, "/usr/sbin" is just the wrong location for a system configuration utility like "ip". I think that this is a bug in Arch linux, since locating "ip" under "/usr" is contrary to the LSB. I'm not an Arch user, though, so I won't comment any further on this.

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

The fix that uses the hidden config setting has been released. I will look for a way to allow the user to specify an alternate install location for the command in setup.py and/or implement code to search for it, but only if I get future question about this issue. I still maintain that Arch needs to fix the install location of the utility. It really should be in the root partition.

Changed in tunnelmanager:
status: Fix Committed → Triaged
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.