Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#12820 closed defect (fixed)

avahi not allowed to use dbus (to speak to netatalk)

Reported by: birnbacs@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: dbus netatalk avahi Cc:

Description

I am using netatalk - 2.2.1-4 on top of ATTITUDE ADJUSTMENT (12.09-rc1, r34185). Hardware is a TP-Link TL-WR1034ND.

In order to build a NAS that will support Apple TimeMachine I installed netatalk. In order to have shared volumes, I also installed avahi-daemon - 0.6.31-5 and dbus - 1.4.14-2.

Per default, avahi is not allowed to send messages via dbus, so avahi cannot contact netatalk.

To permit avahi dbus access, one must add one line in /etc/dbus-1/system.conf:

<policy context="default">

<!-- All users can connect to system bus -->
<allow user="*"/>


<!-- Holes must be punched in service configuration files for

name ownership and sending method calls -->

<deny own="*"/>
<allow own="org.freedesktop.Avahi"/> <!-- add this line -->
<deny send_type="method_call"/>

[and so forth]

This information should be made better accessible for avahi users or, better still, avahi access to dbus should be the default.

Attachments (0)

Change History (12)

comment:1 Changed 5 years ago by Joe Roback <openwrt-devel@…>

I am not sure why avahi needs to talk to dbus at all. I do not have this enabled, I just have a netatalk config in /etc/avahi/services and my mac's all see the netatalk time machine volume(s) just fine. Dbus is just bloat for smaller routers.

/etc/avahi/services/afpd.service

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

comment:2 Changed 5 years ago by birnbacs@…

I have the same /etc/avahi/services/afpd.service. My avahi goes down when I stop dbus daemon. What means of communication between netatalk and avahi do you use?

I started the whole business to make a TimeMachine-savvy router, for which you need netatalk 2.2+, for which I waited until Attitude Adjustment. From what I find on the net I am not the only guy interested in the combination.

I acknowledge that dbus is not popular for probably very good reasons but I cannot see how one can do without it. "works for me" seems not a very good argument to me.

comment:3 Changed 5 years ago by Joe Roback <openwrt-devel@…>

I am confused as to why netatalk and needs to "talk" to avahi in the first place (via dbus). I don't even have dbus on my router and everything works.

The service advertisement that comes from the afpd.service file is all that is required for OSX to discover available TimeMachine disks with regard to avahi. You still have to do the proper netatalk configuration to the volumes, noted in netatalk 2.2.x

comment:4 Changed 5 years ago by Joe Roback <openwrt-devel@…>

works for me, means it works with the defaults, and it is a perfectly good argument (sometimes ;-). I am certain we can work out your issues.

Can you post your afpd.conf and AppleVolumes.default. And I am assuming you are using the default /etc/avahi/avahi-daemon.conf configuration file?

comment:5 Changed 5 years ago by birnbacs@…

Well, thanks for the offer, I will supply the information as soon as I get nearer to my router. I started the installation from default as default can and worked my way up to a running system through reading error logs, I am still surprised there may be an alternative to dbus with the packages of AA-RC1.

One reason why I am using dbus is this reference from the netatalk developers (http://netatalk.sourceforge.net/2.2/htmldocs/installation.html):

[...]
Avahi or mDNSResponder

Mac OS X 10.2 and later prefer Bonjour (aka Zeroconf). Netatalk can advertise AFP server and Time Machine volume by using Avahi or mDNSResponder.

Avahi is a freely-available implementation of Zeroconf. Avahi must be build with DBUS support ( --enable-dbus).
[...]

comment:6 Changed 5 years ago by birnbacs@…

I do apologize, I just realised that this discussion is largely a reiteration of grounds covered in #10245.

Still, this may be a good occasion to wrap up for the rest of the world what options exist for setting up a TimeMachine server.

comment:7 follow-up: Changed 5 years ago by birnbacs@…

Got it. The netatalk netatalk - 2.2.1-4 package is compiled with option --enable-dbus. Therefore, upon starting up, avahi first tries to connect to dbus. To stop this and have avahi prefer the static information in the services directory (especially in afpd.service), I added this line to the [server] section of avahi-daemon.conf:

enable-dbus=no

I suggest to make this setting the default since running dbus on the average OpenWRT router is probably not very common.

comment:8 in reply to: ↑ 7 Changed 5 years ago by Joe Roback <openwrt@…>

Replying to birnbacs@…:

Got it. The netatalk netatalk - 2.2.1-4 package is compiled with option --enable-dbus. Therefore, upon starting up, avahi first tries to connect to dbus. To stop this and have avahi prefer the static information in the services directory (especially in afpd.service), I added this line to the [server] section of avahi-daemon.conf:

enable-dbus=no

I suggest to make this setting the default since running dbus on the average OpenWRT router is probably not very common.

Ok, that is strange, compiling from trunk, netatalk does not have dbus enabled. ldd shows no links to dbus, but maybe the buildbot is configuring/compiling things differently? Are you using snapshot image/packages or an official release?

ldd /usr/sbin/afpd 
        librpc.so => /lib/librpc.so (0x77a0d000)
        libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0x779aa000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x77997000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x77971000)
        libdl.so.0 => /lib/libdl.so.0 (0x7795d000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7793a000)
        libc.so.0 => /lib/libc.so.0 (0x778ce000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x77a30000)

And I am glad you found a workaround. Yea, having dbus enabled for routers seems overkill, when flash space is a premium and the same thing can be achieved with a simple static configuration file.

comment:9 Changed 5 years ago by birnbacs@…

As mentioned I am running AA RC1, r34185. Installed netatalk - 2.2.1-4, via opkg, which, according to /etc/opkg.conf, drew the package from http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/packages/.

I don't mind the dbus support in netatalk, some folks probably require it, it's just that using it should be made non-default via the config file.

Offering a netatalk package and a netatalk-nozeroconf package (see #10245) seems not the best solution to me as it makes installation and maintenance more complicated.

comment:10 Changed 4 years ago by Mike Brady <mikebrady@…>

So, can this ticket be closed? This isn't a fault in avahi.

comment:11 Changed 4 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

comment:12 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.