# netatalk-3.0.2_1,1 can't build



## Peacekeeper2000 (Mar 1, 2013)

I just wanted to upgrade from 3.0.1 to 3.0.2 and upgrade build and new build is failing with 


```
afp_config.c: In function 'configinit':
afp_config.c:136: error: too few arguments to function 'load_volumes'
```

I browse the source code and it seems it only calls 
	
	



```
load_volumes
```
 when 
	
	



```
ZEROCONF
```
 option is enabled. That option is of course essential as you would like to advertice the shares to AFP consumers.

Did anybody manage to compile the new version ? Or has a workaround ( beside no ZEROCONF  )


----------



## Anonymous (Mar 1, 2013)

The build-in ZEROCONF option utilizes net/avahi. Avahi drags-in a hell a lot of dependencies that are as useful as toothache. So, anyway you might want to consider to abandon Avahi in favor of the lean and clean original from Apple net/mDNSResponder. On howto do that, see the following post:

http://forums.freebsd.org/showthread.php?p=143941#post143941.

It might also be worth to quickly review the whole thread for getting the complete picture.


----------



## Khaine (Mar 2, 2013)

I had that problem, and it related to the way the ports make file is configured, because if you go into the src directory it will compile fine, same if you download the source code from source forge and compile it.  Sadly I can't remember what I did to solve it.


----------



## Peacekeeper2000 (Mar 2, 2013)

rolfheinrich said:
			
		

> The build-in ZEROCONF option utilizes net/avahi. Avahi drags-in a hell a lot of dependencies that are as useful as toothache. So, anyway you might want to consider to abandon Avahi in favor of the lean and clean original from Apple net/mDNSResponder. On howto do that, see the following post:
> 
> http://forums.freebsd.org/showthread.php?p=143941#post143941.
> 
> It might also be worth to quickly review the whole thread for getting the complete picture.



Thanks, I have used Avahi with Netatalk 2.x under my former Debian installation and when I moved to FreeBSD just used Avahi/Netatalk 3.x again. You are right with FreeBSD as foundation, it might be better to use the Darwin net/mDNSResponder.  The Avahi (avahi.org) site is anyhow dead.
Quick question: do I need dbus to be build in Netatalk 3? Is there a known conflict with Samba for mDNSResponder?


----------



## Anonymous (Mar 2, 2013)

Peacekeeper2000 said:
			
		

> Quick question: do I need dbus to be build in Netatalk 3?


No!



			
				Peacekeeper2000 said:
			
		

> Is there a known conflict with Samba for mDNSResponder?


Samba 3, no. Samba 4 don't know.


----------



## Khaine (Mar 3, 2013)

Peacekeeper2000 said:
			
		

> Quick question: do I need dbus to be build in Netatalk 3?



No, but Avahi requires dbus


```
pkg_info -r netatalk-3.0.2_1,1
Information for netatalk-3.0.2_1,1:

Depends on:
Dependency: expat-2.0.1_2
Dependency: gnome_subr-1.0
Dependency: perl-5.14.2_2
Dependency: pkgconf-0.8.9
Dependency: pcre-8.32
Dependency: libffi-3.0.11
Dependency: libevent2-2.0.21
Dependency: libdaemon-0.14
Dependency: gdbm-1.9.1
Dependency: db46-4.6.21.4
Dependency: libiconv-1.14
Dependency: libxml2-2.7.8_5
Dependency: dbus-1.4.14_4
Dependency: gettext-0.18.1.1
Dependency: python27-2.7.3_6
Dependency: glib-2.28.8_5
Dependency: gamin-0.1.10_4
Dependency: gio-fam-backend-2.28.8_1
Dependency: dbus-glib-0.94
Dependency: gobject-introspection-0.10.8_3
Dependency: avahi-app-0.6.29_3
Dependency: libgpg-error-1.10
Dependency: libgcrypt-1.5.0_1
```


----------



## Khaine (Mar 3, 2013)

And this is all the junk that avahi depends on using the WITHOUT_X11 knob


```
pkg_info -r avahi-app-0.6.29_3
Information for avahi-app-0.6.29_3:

Depends on:
Dependency: expat-2.0.1_2
Dependency: gnome_subr-1.0
Dependency: perl-5.14.2_2
Dependency: pkgconf-0.8.9
Dependency: pcre-8.32
Dependency: libffi-3.0.11
Dependency: libdaemon-0.14
Dependency: gdbm-1.9.1
Dependency: libiconv-1.14
Dependency: libxml2-2.7.8_5
Dependency: dbus-1.4.14_4
Dependency: gettext-0.18.1.1
Dependency: python27-2.7.3_6
Dependency: glib-2.28.8_5
Dependency: gamin-0.1.10_4
Dependency: gio-fam-backend-2.28.8_1
Dependency: dbus-glib-0.94
Dependency: gobject-introspection-0.10.8_3
```


----------



## Peacekeeper2000 (Mar 4, 2013)

Thanks - I have now already uninstalled AVAHI and DBUS and compiled Netatalk3 without the ZEROCONF option - what has worked so far. mDNSResponder is installed, but it looks like the installation is not 100% clean: at least the man 1M pages are not set up.

Also the configuration to advertise the service is a bit different than I was expecting. At the moment I try the example @rolfheinrich has mentioned in the other thread. Let's where it goes.


----------



## Peacekeeper2000 (Mar 4, 2013)

Ok, it works now using the mDNSResponderPosix like @rolfheinrich has suggested. I also built mdnsadv to advertise the services of my server. currently I am using -v2 and a /var/log/mdnsadv.log to see what is published. It seems that with the -b switch the logging is not working. (Just a single message that it is running in daemon mode).

I have also published my SSH services etc. Also the unpublished shares (of the iTunes Library) are working well as expected. I think the description of the configuration file could be far better (e.g. what is the comment sign), but so far it works

Thank you all


----------



## jigzat (Mar 23, 2013)

I'm having the same issue while trying to upgrade from 3.0.1, can someone please explain me in detail how to do it?


----------



## Peacekeeper2000 (Mar 24, 2013)

Hi,

*I*t compiles, when you leave out the option ZEROCONF. But to be honest: @rolfheinrich is right: AVAHI is on FreeBSD not the preferred way for the Bonjour advertising. I recommend to uninstall/delete it together with the packages that came on board and use mDNSResponderPosix instead. You do not need to change your afpd.conf for that, just a new setup of mDNSResponderPosix is needed. I am using a FreeBSD Server for AFP home shares, iTunes library, generic storage, Time Machine and a Samba share of the iTunes library (for the Sonos System). Over AFP, I see the share as xserver and the Samba share as PC share. The Time Machine volume only pops up when Time Machine is running. So it's all working very nicely.


----------



## jigzat (Mar 26, 2013)

Thank you very much to all, it is working partially. I don't have the annoying cnid error message but the mDNSResponder is not working, or at least is not advertising. There is very little information on how to configure mDNSResponder and all the posts talk about using it with Time Machine. All the posts have instructions about creating mdnsadv, although the port creates a very similar file called mdnsd. The configuration file is called mdnsadv.conf but the service doesn't start at boot and there is no corresponding file for mdnsd. I try with the method posted on the other threads and I also try to change the configuration file name to mdnsd.conf but there is no change. The server is not advertised on the network. Any ideas?


----------



## Khaine (Mar 27, 2013)

I followed thisguide and got everything to work.

Follow these steps from the linked post and it should all work

install Apple's mDNSResponder net/mDNSResponder
create the file /usr/local/etc/rc.d/mdnsadv with the following content:


```
#!/bin/sh

# PROVIDE: mdnsadv
# REQUIRE: LOGIN mdnsd
#
# Add the following lines to /etc/rc.conf to enable the mDNSResponder service advertising:
#
#    mdnsadv_enable="YES"

. /etc/rc.subr

name="mdnsadv"
rcvar=${name}_enable

command="/usr/local/bin/mDNSResponderPosix"

load_rc_config $name

: ${mdnsadv_enable="NO"}

command_args="-f /usr/local/etc/mdnsadv.conf >/dev/null 2>&1 &"

run_rc_command "$1"
```

make the file executable: [cmd=]chmod ugo+x /usr/local/etc/rc.d/mdnsadv[/cmd]
create the advertising configuration file /usr/local/etc/mdnsadv.conf with the following contents.  This will share the afp volume.  It should appear as AFP Server:


```
AFP Server
_afpovertcp._tcp
548
```

add to /etc/rc.conf the following lines:


```
mdnsadv_enable="YES"
```

start the service with `su /usr/local/etc/rc.d/mdnsadv start`


----------



## jigzat (Mar 27, 2013)

Although I followed those the instructions and some others it didn't worked out, at least the network advertising. 

I finally fixed it? by removing everything up and then reinstall netatalk3 with ZEROCONF enabled, for some reason after cleaning up everything it built without issues. 

After checking the active processes with top I found that everything was running except AVAHI, so I jump into /usr/ports/net/avahi-app install it and then...nothing, I left to eat something and when I got back, the server was listed in my mac under "SHARE". Is weird since netatalk3 supposedly installs Avahi, but under this version it wasn't running. I might have installed more things than I should but is working now so I don't want to touch it until ports has the new 3.0.3 version.


----------



## Khaine (Mar 27, 2013)

If you want to use Avahi you have to compile Netatalk with zeroconf enabled.  To use mDNSResponder you do not enable zeroconf while building Netatalk.  I know that this can be a little confusing.


----------



## Peacekeeper2000 (Mar 27, 2013)

jigzat said:
			
		

> ...
> After checking the active processes with top I found that everything was running except AVAHI, so I jump into /usr/ports/net/avahi-app install it and then...nothing, I left to eat something and when I got back, the server was listed in my mac under "SHARE". Is weird since netatalk3 supposedly installs Avahi, but under this version it wasn't running. I might have installed more things than I should but is working now so I don't want to touch it until ports has the new 3.0.3 version.



mDNSResponder and AVAHI are conflicting. So you would need to decide either or. My Server is now running very well with mDNSResponder and advertising everything.

mdnsd is not needed - this is the Bonjour "search" demon: it will search for the server what is available and will present that to the server.

the mdnsadv script is packaging the Advertising program ( mDNSResponderPosix ) together with the parameters for easier startup and asa standard startup when the server reboots.

BTW: I am using the following line:
	
	



```
command_args="-v 2 -f /usr/local/etc/mdnsadv.conf >/var/log/mdnsadv.log 2>&1 &"
```
 and you will get something like


```
mDNSResponderPosix: Starting in foreground mode, PID 3925
Registered interface bge0
mDNSResponderPosix: Registered service 0, name 'myserver', type '_afpovertcp._tcp', port 548
mDNSResponderPosix: Registered service 1, name 'Samba on myserver', type '_smb._tcp', port 445
mDNSResponderPosix: Registered service 2, name 'myserver', type '_adisk._tcp', port 9
mDNSResponderPosix: Registered service 3, name 'myserver', type '_ssh._tcp', port 22
mDNSResponderPosix: Registered service 4, name 'myserver', type '_sftp-ssh._tcp', port 22
mDNSResponderPosix: Registered service 5, name 'myserver', type '_device-info._tcp', port 548
```

when you use the following config file:

```
# mDNSResponderPosix config file
# used with /usr/local/etc/rc.d/mdnsadv service script
#
myserver
_afpovertcp._tcp
548
title=myserver
model=Xserve

Samba on myserver
_smb._tcp
445

myserver
_adisk._tcp
9
sys=waMA=33:33:33:33:33:33,adVF=0x100
dk0=adVF=0x83,adVN=TimeBox

myserver
_ssh._tcp
22

myserver
_sftp-ssh._tcp
22

myserver
_device-info._tcp
548
model=Xserve
```

The MAC Adress behind waMA= .. needs of course to be your network card MAC


----------



## jigzat (Mar 28, 2013)

Thank you all for the answers, I will have that in mind when I upgrade to 3.0.3 but I don't think the issue was related with mDNSResponder since I also removed it, or maybe that is what I tried to do. I remember that the first time that I try to install it after removing everything there was an error related to some library that was conflicting with avahi that was installed with mDNSResponder, I don't remember which one, maybe libxml2. Maybe mDNSResponder wasn't properly removed although I used [cmd=]pkg_deinstall[/cmd] and [cmd=]make deinstall[/cmd] just in case.


----------

