atom feed11 messages in org.gnome.networkmanager-listRe: if-up hooks not working
FromSent OnAttachments
Scott SeveranceNov 28, 2007 4:31 pm 
Darren AlbersNov 28, 2007 5:34 pm 
Scott SeveranceNov 29, 2007 1:07 am 
Scott SeveranceNov 30, 2007 12:33 pm 
Darren AlbersNov 30, 2007 3:52 pm 
Scott SeveranceNov 30, 2007 7:58 pm 
Darren AlbersDec 1, 2007 5:17 am 
Darren AlbersDec 1, 2007 5:26 am 
Scott SeveranceDec 1, 2007 6:56 pm 
Dan WilliamsDec 3, 2007 6:33 am 
Scott SeveranceDec 3, 2007 12:02 pm 
Subject:Re: if-up hooks not working
From:Scott Severance (sco@scottseverance.us)
Date:Nov 30, 2007 7:58:22 pm
List:org.gnome.networkmanager-list

On 11/30/07, Darren Albers <dalb@gmail.com> wrote:

On Fri, 2007-11-30 at 14:33 -0600, Scott Severance wrote:

snip

After poking around the filesystem and NetworkManager's scanty documentation, I determined that I should place my script in /etc/network/if-up.d. However, I've discovered that those scripts get called when switching from wireless to wired, but not the other way around. How can I persuade NetworkManager to run my script *every* time it switches interfaces?

snip

Thanks for the reply. I gather from the NetworkManagerDispatcher man page that I should put my script in /etc/NetworkManager/dispatcher.d and modify it so it only runs when the second command line argument is "up." However, in its new location the script never gets executed. What's even more confusing is that, apparently the only reason the script worked at all in /etc/network/if- up.d was because there's a script in /etc/NetworkManager/dispatcher.d which calls run-parts on the other directory. Why isn't NetworkManagerDispatcher running my script?

After rebooting the computer in question as well as my server because NFS was acting up, my script now seems to get run reliably if I put it in /etc/network/if-up.d. However, contrary to the docs, the only script in /etc/NetworkManager/dispatcher.d that ever gets executed is 01ifupdown. Since that script calls run-parts on /etc/network/if-up.d, My script gets executed in that directory.

Is the NetworkManagerDispatcher man page wrong, or am I experiencing some kind of bug?

By the way, I'm running Ubuntu Gutsy.

Is the script only owned by root and executable? Do you see the script execute when you tail syslog?

The script is owned by myuser:root, with 770 permissions. I chowned to root:root, but it didn't make any difference. One reason that I know it isn't running is because the script logs several messages to syslog, and those messages don't show up. NetworkManagerDispatcher doesn't itself log the scripts it runs. So, the script definitely isn't executing.