Results 1 to 9 of 9

Thread: Ubuntu Server 10.04 Hostapd daemon not starting

  1. #1
    Join Date
    Mar 2008
    Beans
    2

    Question Ubuntu Server 10.04 Hostapd daemon not starting

    Weirdest thing ever and i'm going nuts trying to figure it out.

    tried the command line

    sudo /usr/sbin/hostapd -P /var/run/hostapd.pid -B /etc/hostapd/hostapd.conf

    works no prob

    so I figured maybe something buggered with the start-stop-daemon dealio in /etc/init.d/hostapd.
    put the command line as it should look after all the stuff is filled in at a prompt. Works.
    try to start script via sudo /etc/init.d/hostapd start script says its starting and gives a OK but the daemon never starts and its no where in memory when i do ps waux | grep hostapd
    Is it just me or has other people ran into this?
    How do I test a start script to see why its failing even though it says its not?
    I'm totally mystified as everything works when i check manually.

  2. #2
    Join Date
    Mar 2008
    Beans
    2

    Talking Re: Ubuntu Server 10.04 Hostapd daemon not starting

    I sat down and looked at the script a couple nights ago. The /etc/init.d/hostapd has a clause in it that it will exit if the config in /etc/default/hostapd does not have RUN_DAEMON="YES"
    Even though the forced to run as a daemon (-B) switch is being used so there its not going to be any other way as-is.
    On my setup /etc/default/hostapd had RUN_DAEMON="YES" commented out.
    Ya this is a silly mistake on my part as I should have been able to catch this sooner. But I never dreamed someone would add such a dumb clause and require everyone to go digging through scripts in order to get the daemon to load.
    I mean... wouldn't it make more sense if it was ...
    Code:
    if [ $RUN_DAEMON == "NO" ]; then
      exit 0
    fi
    rather than...
    Code:
    if [ $RUN_DAEMON != "YES" ]; then
      exit 0
    fi
    that way if nothing is specified at all it would default to yes and the script would load the daemon.
    Unless the idea is we are going to have Micro$oft's "Are you REALLY sure?" style of scripts.

  3. #3
    Join Date
    Jan 2010
    Beans
    13

    Re: Ubuntu Server 10.04 Hostapd daemon not starting

    Quote Originally Posted by BadOpCode View Post
    On my setup /etc/default/hostapd had RUN_DAEMON="YES" commented out.
    So glad you found this, I would have spent ages trying to solve exactly the same problem on my lucid server: works when run manually as you describe, but daemon doesn't seem to start at boot time though.

    I just uncommented the line above and restarted, and bingo, hostapd now runs at startup!

  4. #4
    Join Date
    Jun 2010
    Beans
    2

    Re: Ubuntu Server 10.04 Hostapd daemon not starting

    Quote Originally Posted by BadOpCode View Post
    On my setup /etc/default/hostapd had RUN_DAEMON="YES" commented out.
    Thanks a lot. That helped me.

  5. #5
    Join Date
    Mar 2006
    Beans
    4
    Distro
    Kubuntu 9.10 Karmic Koala

    Talking Re: Ubuntu Server 10.04 Hostapd daemon not starting

    Thanks ! Its working

  6. #6
    Join Date
    Jul 2010
    Location
    Henley-on-Thames,UK
    Beans
    4
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ubuntu Server 10.04 Hostapd daemon not starting

    Thanks!
    I've been tearing my hair out over this one!

  7. #7
    Join Date
    Dec 2010
    Beans
    16

    Re: Ubuntu Server 10.04 Hostapd daemon not starting

    I'm also having an issue with the Hostapd daemon not starting.

    Running sudo /usr/sbin/hostapd -P /var/run/hostapd.pid -B /etc/hostapd/hostapd.conf also works fine for me & returns:
    Using interface wlan0 with hwaddr 18:f4:6a:a7:51:8d and ssid '

    However if I run /etc/init.d/hostapd start it doesn't do anything nor return with a message.
    Would you mind posting your hostapd daemon here?

    Thanks.

  8. #8
    Join Date
    May 2009
    Location
    Australia
    Beans
    13
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Ubuntu Server 10.04 Hostapd daemon not starting

    I think the RUN_DAEMON in /etc/default/hostapd refers to if hostapd should be run or not at all - in contrast to the -B switch.

    This saves having to edit symlinks in the rc?.d directories when you want to enable or disable running it on boot.

    But that's just a educated guess.

  9. #9
    Join Date
    Aug 2006
    Beans
    Hidden!

    Re: Ubuntu Server 10.04 Hostapd daemon not starting

    It appears that in Precise someone tried to fix the issue, and actually made it worse. RUN_DAEMON is no longer included in the package-supplied /etc/default/hostapd file, nor is it checked in the init script anymore. So, you'd think it's no longer needed--and you'd be wrong.

    To make matters worse, neither the init script (which by the way is still pure classic sysVinit) nor the default config specify the location of the configuration file. So in /etc/default/config you must explicitly define RUN_DAEMON and DAEMON_CONF or hostapd won't start nor report any error. It's possible I missed it, but there don't seem to even be any errors in /var/log/syslog or /var/log/messages.

    Perhaps the release team is trying to score one of these.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •