Bug 704809

Summary: Need to restart avahi-daemon every few minutes
Product: Red Hat Enterprise Linux 6 Reporter: mo.ucina
Component: avahiAssignee: Michal Sekletar <msekleta>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: brunojcm, glide3, igeorgex, msanders, prc, twaugh
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-14 08:28:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 670971, 1075802, 1172231    

Description mo.ucina 2011-05-15 07:37:56 UTC
Description of problem:

In preparation to a new ipad I decided to set up Airprint . Setup was not too problematic but in operation I find that I need to restart avahi-daemon every few minutes to get printer to be visible . If I catch it early enough I can even print documents . Looking around I believe that my problem is : https://bugzilla.redhat.com/show_bug.cgi?id=249304 . Now I see that the fix is delivered in fc15 , my question is will we see this fix in RHEL 6 / 6.1 ? Is it even doable , what is the way forward ?

Version-Release number of selected component (if applicable):

CUPS 1.4.2

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Tim Waugh 2011-05-19 10:34:11 UTC
There is still some debate about how this will be implemented upstream, and it has not actually been deployed yet (because Fedora 15 is not yet released).  Until it has been "battle tested" and has some upstream acceptance I don't think we can add this experimental feature to Red Hat Enterprise Linux.

It sounds like the main problem you are seeing right now is some kind of issue with avahi.  It certainly should be possible to provide Airprint-compatible discovery using avahi.

Changing component and reassigning.

Comment 4 RHEL Program Management 2011-07-06 01:36:28 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 5 RHEL Program Management 2012-07-10 08:26:34 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2012-07-10 23:05:43 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 7 Rory 2012-08-15 18:20:11 UTC
Hi. I might be way off here, but I had the same problem with Fedora 17, RHEL 6.2, and CentOS 6.2.

I have to restart "avahi-daemon.service" and or "avahi-daemon.socket" with systemctl or service every couple of minutes in order for iMac machines on the network to discover the AFP server automatically in their finder window. If they restart their machines, come out of standby, sleep or I restart the server then we have to restart this process on the server for them to be able to find the server for a short while again.


My solution was to do all of the following. Probably the 1st that helped the most.


1: Very over the top port opening for avahi, netatalk protocols
---------------------------------------------------------------
Notice the UDP and TCP lines.

548  = AFP over TCP
5353 = Multicast DNS
5354 = Multicast DNS Responder IPC


# AFP / Netatalk / Apple Talk Protocol for Trilogy
#
-A INPUT -p tcp -m state -m tcp --dport 548 --state NEW -j ACCEPT
-A INPUT -p udp -m state -m udp --dport 548 --state NEW -j ACCEPT
#
-A INPUT -p tcp -m state -m tcp --dport 5353 --state NEW -j ACCEPT
-A INPUT -p udp -m state -m udp --dport 5353 --state NEW -j ACCEPT
#
-A INPUT -p tcp -m state -m tcp --dport 5354 --state NEW -j ACCEPT
-A INPUT -p udp -m state -m udp --dport 5354 --state NEW -j ACCEPT


2: Change the following line in the /etc/nsswitch.conf
------------------------------------------------------

#hosts:      files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns myhostname
hosts:      files mdns4_minimal dns mdns4 mdns


3. Stoped the samba and nmb services
------------------------------------


4. Add the below to rc.local (which needs to be created on some distro's)
-------------------------------------------------------------------------
sleep 15
/etc/rc.d/avahi-daemon stop
/etc/rc.d/avahi-daemon start


Hope this helps someone, drove me almost crazy.

Regards
Rory

Comment 8 RHEL Program Management 2012-12-14 08:20:31 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 Bruno Medeiros 2013-02-20 17:07:30 UTC
Rory seems right, the problem is related to firewall. After a 'service iptables stop' (didn't tested the lines above), the problem is gone.

Comment 10 Rory 2013-02-20 17:22:10 UTC
(In reply to comment #9)
> Rory seems right, the problem is related to firewall. After a 'service
> iptables stop' (didn't tested the lines above), the problem is gone.

Happy to hear it helped someone else and that I wasn't totally way off (in some cases at least).

Regarding the iptables advise I gave above: I just searched the 'vim /etc/services' file to see what ports related to this particular server / protocol (being AFP and mDNS)

then added then to 'vim /etc/sysconfig/iptables' file and restarted iptables. Both UDP and TCP just in case.

Depending on your OS (Centos/RH/Fedora) the lines can look like
-A INPUT .............
OR
-A RH-Firewall-1-INPUT .............

Opening you iptables file should assist in giving you the correct format.
The location those lines could be placed are near the port 22 default ssh rule.

I don't think I had to enable a SELinux bool to get it working.

Good luck

Comment 13 RHEL Program Management 2013-10-14 01:05:30 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 16 Michal Sekletar 2015-10-14 08:28:16 UTC
Seems like configuration issue, rather than avahi bug.