Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to have radvd (the IPv6 router advertisement daemon) run on startup on Fedora 13. However, the network interface that it will use must be up, otherwise the daemon won't start.

If I run the daemon manually when the system is running everything works fine.

However, I can't figure out how to tell the Fedora 13 init system "run radvd on boot but only after wlan0 is up". wlan0 is managed by NetworkManager and it would be nice if I could keep it that way.

I tried enabling radvd on boot using the GUI system-config-services tool; then radvd tries to start in the boot process (after NetworkManager) but fails because wlan0 does not exist. I also tried changing ONBOOT=no to ONBOOT=yes in /etc/sysconfig/networking/devices/ifcfg-wlan0 but that also didn't help (I don't understand exactly how the configuration in /etc/sysconfig/networking/ interacts with NetworkManager).

It seems to me that this kind of thing should be straightforward with Upstart but I can't find an Upstart event that tells me "a network interface is up".

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

I am not too familiar with Fedora, but I know network manager does have a built-in system to run scripts after an interface comes up. On Arch linux the scripts are located at

/etc/NetworkManager/dispatcher.d

You will need to create a script to say when the interface is up, do this, when the interface is down do this. In your case, start raddvd when the interface is up, and stop it when the interface is down. Arch Linux's wiki has a bit more info and an example script that should get your going just fine.

https://wiki.archlinux.org/index.php/NetworkManager#Network_Services_with_NetworkManager_Dispatcher

share|improve this answer
add comment

On Ubuntu (you may have to adapt this for Fedora if it doesn't have the same chain):

  • NetworkManager runs scripts in /etc/NetworkManager/dispatcher.d when an interface comes up or down.
    In particular, /etc/NetworkManager/dispatcher.d/01ifupdown runs the ifupdown scripts.
  • Ifupdown runs scripts in /etc/network/if-up.d and /etc/network/if-down.d.
    In particular, /etc/network/if-up.d/upstart and /etc/network/if-down.d/upstart trigger Upstart events. Here's how you would catch these events in a service description:

    start on net-device-up IFACE=wlan0
    stop on net-device-down IFACE=wlan0
    
share|improve this answer
    
I still couldn't find an Upstart event triggered on Fedora, but I could write my own script in /etc/NetworkManager/dispatcher.d/ to start the daemon. I have the feeling Fedora integrates Upstart considerably less than Ubuntu (they also plan to switch to systemd in F15). Great answer, thanks. –  Catalin Iacob Oct 30 '10 at 8:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.