Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

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

    Scheduled Pinned Locked Moved pfSense Packages
    19 Posts 3 Posters 3.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cwagzC
      cwagz
      last edited by

      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

      Netgate 6100 MAX

      1 Reply Last reply Reply Quote 0
      • cwagzC
        cwagz
        last edited by

        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

        Netgate 6100 MAX

        1 Reply Last reply Reply Quote 0
        • cwagzC
          cwagz
          last edited by

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

          Netgate 6100 MAX

          1 Reply Last reply Reply Quote 0
          • cwagzC
            cwagz
            last edited by

            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

            Netgate 6100 MAX

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              Install Service Watchdog package and use it?

              1 Reply Last reply Reply Quote 0
              • cwagzC
                cwagz
                last edited by

                @doktornotor:

                Install Service Watchdog package and use it?

                That worked great. Thank you for the suggestion.

                Netgate 6100 MAX

                1 Reply Last reply Reply Quote 0
                • D
                  doktornotor Banned
                  last edited by

                  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?  ::)

                  1 Reply Last reply Reply Quote 0
                  • cwagzC
                    cwagz
                    last edited by

                    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";
                    

                    Netgate 6100 MAX

                    1 Reply Last reply Reply Quote 0
                    • D
                      doktornotor Banned
                      last edited by

                      Yes, just replace 5 with something bigger.

                      1 Reply Last reply Reply Quote 0
                      • cwagzC
                        cwagz
                        last edited by

                        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!

                        Netgate 6100 MAX

                        1 Reply Last reply Reply Quote 0
                        • P
                          phil.davis
                          last edited by

                          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.

                          As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                          If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                          1 Reply Last reply Reply Quote 0
                          • D
                            doktornotor Banned
                            last edited by

                            @cwagz:

                            Looks like it does not like the

                            service_start("avahi")
                            

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

                            1 Reply Last reply Reply Quote 0
                            • cwagzC
                              cwagz
                              last edited by

                              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

                              Netgate 6100 MAX

                              1 Reply Last reply Reply Quote 0
                              • cwagzC
                                cwagz
                                last edited by

                                this was where i found the info:

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

                                Netgate 6100 MAX

                                1 Reply Last reply Reply Quote 0
                                • D
                                  doktornotor Banned
                                  last edited by

                                  ~~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.

                                  1 Reply Last reply Reply Quote 0
                                  • cwagzC
                                    cwagz
                                    last edited by

                                    Thank you for doing the work you did.

                                    Netgate 6100 MAX

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      doktornotor Banned
                                      last edited by

                                      Does the checkbox work for you? :P

                                      1 Reply Last reply Reply Quote 0
                                      • cwagzC
                                        cwagz
                                        last edited by

                                        @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.

                                        Netgate 6100 MAX

                                        1 Reply Last reply Reply Quote 0
                                        • cwagzC
                                          cwagz
                                          last edited by

                                          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

                                          Netgate 6100 MAX

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.