2.2.3 Avahi Exits after Reboot - Have to Hit "Save" to Get Running



  • I was running bare metal and rebuilt in ESXi 6 when 2.2.3 came out.  Ever since doing this Avahi always quits after a reboot with the error:

    Jul 6 20:59:51 avahi-daemon[25109]: avahi-daemon 0.6.31 exiting.
    Jul 6 20:59:51 avahi-daemon[25109]: WARNING: Failed to contact D-Bus daemon.
    Jul 6 20:59:51 avahi-daemon[25109]: dbus_bus_get_private(): Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    Jul 6 20:59:51 avahi-daemon[25109]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
    Jul 6 20:59:51 avahi-daemon[25109]: avahi-daemon 0.6.31 starting up.

    If I go and hit save in the Avahi menu it will then start and run fine until the next reboot.  I am not sure if this is the renamed package that has this problem or if it something to do with ESXi.  I have spun up a couple VMs from scratch and they all do this.

    Any ideas on what I can do to fix this?

    Thanks,
    Chad



  • Is anyone else experiencing this?  Is there a log file I can look at to try and figure out how to fix it?

    Avahi has been a great addition to my network as it lets wireless guest subnet users airplay to devices on my internal lan network.

    Thanks,
    Chad



  • I think it might just need to have a delay in initial startup so the dbus stuff is running when it starts…  Just guessing.



  • Could someone help me schedule a cron task that would mimic hitting the "save" button on the avahi menu?  I want to schedule this to happen after reboot and then early each morning to keep the thing working.

    Any help is appreciated.

    If I could help fix the package, with my limited skills, I would be happy to try if someone could point me in the right direction on that as well.

    Regards,
    Chad


  • Banned

    Install Service Watchdog package and use it?



  • @doktornotor:

    Install Service Watchdog package and use it?

    That worked great. Thank you for the suggestion.


  • Banned

    Meanwhile, I've created a PR to clean up the package code, however I don't think it's gonna help here at all… You can try it though: https://github.com/pfsense/pfsense-packages/pull/983 - Replace the files in /usr/local/pkg after making a backup.

    Maybe sleep 5 is not enough time for the dbus junk to start?  ::)



  • Thanks for doing this.  I will try to figure it out tonight and see if it works.

    Do I just change the 5 to a 10 in my version to test it out?

    	if (file_exists(AVAHI_BASE . "/etc/rc.d/dbus")) {
    		$start .= AVAHI_BASE . "/etc/rc.d/dbus onestop\n";
    		$start .= "/bin/rm /var/run/dbus/dbus.pid >/dev/null 2>&1\n";
    		$start .= AVAHI_BASE . "/etc/rc.d/dbus onestart\n";
    	}
    	$start .= "sleep 5\n";
    	$start .= AVAHI_BASE . "/sbin/avahi-daemon -D\n";
    	$start .= "/etc/rc.conf_mount_ro\n";
    

  • Banned

    Yes, just replace 5 with something bigger.



  • Looks like it does not like the

    service_start("avahi")
    
    Crash report begins.  Anonymous machine information:
    
    amd64
    10.1-RELEASE-p15
    FreeBSD 10.1-RELEASE-p15 #0 c5ab052(releng/10.1)-dirty: Sat Jul 25 20:20:58 CDT 2015     root@pfs22-amd64-builder:/usr/obj.amd64/usr/pfSensesrc/src/sys/pfSense_SMP.10
    
    Crash report details:
    
    PHP Errors:
    [11-Aug-2015 17:43:35 America/Los_Angeles] PHP Fatal error:  Call to undefined function service_start() in /usr/local/pkg/avahi.inc on line 217
    
    Filename: /var/crash/minfree
    2048
    

    I am not sure how to fix this.  I did sign up for Github though and am very interested in learning.

    Thanks!



  • I put some comments on that PR 983. The functions to start and stop the service are actually called:
    start_service
    stop_service

    So edit avahi.inc and fix those and see how it goes.


  • Banned

    @cwagz:

    Looks like it does not like the

    service_start("avahi")
    

    Yeah it obviously doesn't like those; already fixed. :D



  • Ok so changing the sleep time does not help the problem.  I tried up to 100 which just changed the position of the error in the log.

    I found this on another forum saying that "enable-dbus=yes" should be set to no.  I made this change and the service started after reboot and seems to be working.

    Does this make sense?  Does restarting the service after boot or hitting save actually start it without the dbus requirement?

    Chad



  • this was where i found the info:

    https://dev.openwrt.org/ticket/12971


  • Banned

    ~~Well frankly I'm not touching that. If you don't want dbus, then you compile the thing without dbus. It's working perfectly fine for many people without such hacks, really no idea what's wrong with dbus for you. It the dbus-daemon running? Does the socket exist?

    File a bug at Redmine perhaps to get it recompiled without dbus, then all the dbus-related stuff can be simply removed from the code as there's no point in installing dbus, running and dealing with dbus in that case.~~

    Scratch this. Added a checkbox to disable D-BUS to the PR linked above. Don't have time to investigate this shit, and generally no interest in using this package either. I did code-style fixes. Don't want to touch it ever again.



  • Thank you for doing the work you did.


  • Banned

    Does the checkbox work for you? :P



  • @doktornotor:

    Does the checkbox work for you? :P

    Yes it works great.  Not sure whats up with my stuff.  This has persisted across several VMs.  I do not even have a var/run/dbus directory.  Looks alot like this bug to me:
    https://redmine.pfsense.org/issues/2535

    Anyway - it seems to work fine without Dbus.

    Thanks again.



  • I went ahead and submitted a bug on this issue after testing again in a brand new clean VM.
    https://redmine.pfsense.org/issues/4932