You are not logged in.

#1 2010-09-11 04:05:29

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

[SOLVED] Why doesn't NetworkManager's dispatcher work?

I've tried putting various scripts in /etc/NetworkManager/dispatcher.d but none of them start after i've booted and a connection is established.

If i restart networkmanager with /etc/rc.d/networkmanager restart that does not work.

In my case, i'm trying to start openntpd with networkmanager's dispatcher. I am only able to start openntpd manually with /etc/rc.d/openntpd start, but not with the dispatcher. My time is always messed up unless i start openntpd manually.

This is the script i've put in /etc/NetworkManager/dispatcher.d/20_openntpd:

#!/bin/sh

INTERFACE=$1 # The interface which is brought up or down
STATUS=$2 # The new state of the interface

case "$STATUS" in
    'up') # $INTERFACE is up
    exec /etc/rc.d/openntpd start
    ;;
    'down') # $INTERFACE is down
    exec /etc/rc.d/openntpd stop # Disable if having more than one active interface might bring ntpd down unnecessarily
    ;;
esac

It should start openntpd when networkmanager gets connected at boot up, right?
Well, nothing appears to happen.

Any ideas? And thanks for looking!

Last edited by trusktr (2010-09-22 05:48:08)


joe@trusktr.io - joe at true skater dot io.

Offline

#2 2010-09-21 18:43:43

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

I haven't been able to make it work yet, but also I think it's Windows messing up my time... Everytime the hardware clock and system clock is set correctly in Arch, then my Windows system time is horribly off the next time i log into windows.

Let's see if there's a fix...


joe@trusktr.io - joe at true skater dot io.

Offline

#3 2010-09-21 22:03:15

xaber
Member
Registered: 2010-09-20
Posts: 42

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

Mmmmm... I really don't know how to use the networkmanager dispatcher, but as I can understand, you would like openntpd to be executed at startup time right? Couldn't use the autostart feature of your desktop environment instead of networkmanager? I know that this does not solve the NM problem and that is not a so refined way for handling the problem as the one using the nm dispatcher script, but could be a fixture in any case!

Offline

#4 2010-09-21 22:12:33

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

just trowing some ideas, did you do chmod +x /etc/NetworkManager/dispatcher.d/20_openntpd ?


Give what you have. To someone, it may be better than you dare to think.

Offline

#5 2010-09-22 05:37:59

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

True that, @xaber. I thought of just settling with that. But it's bugging me knowing that it isn't working! hehe.

Let me try that @wonder. Maybe you're right!


joe@trusktr.io - joe at true skater dot io.

Offline

#6 2010-09-22 05:42:27

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

Aha! Indeed that solved the problem. Thanks @wonder. I'll definitely think of that next time i encounter such a problem. roll

EDIT: That piece of info is missing from the wiki so I'm adding it. wink

Last edited by trusktr (2010-09-22 05:43:30)


joe@trusktr.io - joe at true skater dot io.

Offline

#7 2010-09-22 06:25:40

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

Off-topic observation: you say the info is missing from the wiki - others, possibly including the article's author, might reasonably assume that any Archer writing a script that starts with "#!/bin/sh" already knows that it should be made executable.

Offline

#8 2010-09-22 07:26:13

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

That could be very true, tomk. It'll just serve as a useful sidenote. It had me stuck for a good while.

Last edited by trusktr (2010-09-22 07:26:40)


joe@trusktr.io - joe at true skater dot io.

Offline

#9 2010-09-22 13:44:09

xaber
Member
Registered: 2010-09-20
Posts: 42

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

trusktr wrote:

True that, @xaber. I thought of just settling with that. But it's bugging me knowing that it isn't working! hehe.

Let me try that @wonder. Maybe you're right!

I really can understand what you mean! wink Anyway, I'm happy you solved the problem: many times the solution is just a few centimetres far! wink

Offline

#10 2010-09-23 00:57:20

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Why doesn't NetworkManager's dispatcher work?

Indeed, this is true. It has happened a couple times already!


joe@trusktr.io - joe at true skater dot io.

Offline

Board footer

Powered by FluxBB