[done] Avahi - Zeroconf Networking

If there's software you need and you can't find, make a request for it.
prfaasse
Posts: 14
Joined: 22. Sep 2009, 18:31
Location: Amsterdam

Re: Avahi - Zeroconf Networking

Post by prfaasse » 29. Dec 2009, 19:52

The most-used avahi-interfaces (to the best of my knowledge..) are the C/C++ and -if you're running kde of any kind- Qt3 and/or Qt4 interfaces, approximately in that order. Please understand, you're dealing with someone who has never run Salix (shame on me :D ), so whatever i suggest may not even be applicable to Salix at all.

In case you're interested, i can give some ideas of how & why i built avahi for zenwalk the way i did. But by all means feel free to do as you please ;)

One thing: zeroconf, avahi, bonjour, mDNS, the same protocol has a confusingly large number of names. Apple itself is guiolty of the names zeroconf, bonjour and mDNS. Avahi is one of the implementations of this 'zeroconf' protocol. There have been others. For some of these, avahi has the facility to provide the same interface as the 'other' implementation. So: For ease of integration, i'd recommend enabling the build of the mDNS (alias original Apple) compatibility interface: some applications will want to link into avahi pretending to 'see' the original Apple interface. There is another 'incarnation' of the 'zeroconf' protocol, called howl. I saw no reason to disablling the compatibility mode for it. If any application 'wants' to interface using C/C++ with avahi, i prefer to have the compatibility headers/libraries present :D .

In my buildfile, i configured the user/group 'deamon', but feel free to do as you please :D I disabled autopid, and provide libdaemon, but i have no good reason for that. Possibly, there *is* a good reason, but i 'took over' building avahi from the zenwalk maintainer 'Tibors', who selected that, and i've never seen a good reason to change it.

As for 'language interfaces'/'bindings', i've been a bit more conservative. I did enable 'gtk' (assuming Salix is also a gtk-ish distro, that seems logical), but also did not disable python and enabled pygtk. The reason is that -if all goes well- this results in that -as part of an avahi build- a number of gui-applications are compiled: a standalone gui-avahi-browser, a ssh and a vnc browser. These gui-apps allow you to see what computers and what services are present on the local network. You can also browse ssh and vnc servers, and -if all is well- connect to them from the gui app. Avahi itself tends to be very low-profile, so having *some* apps in the menu as a result of avahi being present is -in my view- not bad. Expect one problem: there is no 'icon' for the menu items in the avahi source package. I 'stole' one from the avahi www-site.

I am one of the zenwalk-kde-nutcases, so to find *me* enabling Qt4 should not be a surprise. :D kde4/qt4 hase 'native' support for avahi, and i always enjoy entering the 'zeroconf:/' url in my konqueror to get a view of ssh, sftp and the like services as avalable. NB: it is not difficult to make kde support more protocols, that is just very badly documented....

W.r.t. kde3/Qt3, well that *is* a bit of a troublesome thing: there is kdnssd-avahi, but packaging that results in a number of files that are supposed to over-write some of the libraries of the kde3-libs package. Oogly to the extreme: the order of installing packages becomes important: over-write kdnssd-avahi with a 'fresh' kdelibs package, and you lose the kdnssd-avahi. I solved that by building kdnssd-avahi *into* the kde3libs package itself (i was also the kde3-maintainer, so i could get away with that..). I called that the 'avahi-dance' with kdelibs: over-write the kdelibs file, before the actual packaging, and the resulting kdelibs-with-kdnssd-avahi-inside package is one package, that avoids the 'install-order problem. Still not very 'clean' but that is at least robust. Unless you are interested in the more obscure tricks of package-building, i'd not recommend you follow that lead ;) Besides, the days of kde3 are more than numbered, even i run kde4 full-time now :D

And *after* you've built a nice avahi-package comes the 2-nd hurdle: to see how many other packages/packagers will actually build in support for avahi (or zeroconf by any of its other names). Because: having a 'bare' avahi is about half the trick: if no program exports its services to avahi, and if nobody actually acesses those services *using* avahi, then building avahi itself is more or less an excercise in futility. What is possible:

- kde (3 and 4, both have support)
- kdegames: kbatteship group play
- pidgin (bonjour chat)
- cups (i managed to get that active once, but i have no operational printer.... :D )
- apache (browse for www-servers...)
- amarok (experimented with mt-daapd: an i-tunes server on your local machine.. almost works...)
- ssh/sftp (browse and up/download... )
- vnc

Some applications do not have a 'native' support for avahi/zeroconf: they have no source that 'presents' services for avahi to pass along. But: avahi has a 'cheat-mode', which can be used to export the existence of the services. If you'd care to look at the tail of my zenwalk buildfile, you'd find some scripting that sets files so that some services that are enabled in the rc-scripts are 'fake-registered' with avahi. A bit tricky , and not completely 'clean', but better than nothing...

So, thus i've been ranting long enough..... Good building... :D
in case of panic: scream and run in circles

User avatar
JRD
Salix Warrior
Posts: 949
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: Avahi - Zeroconf Networking

Post by JRD » 29. Dec 2009, 23:37

Thanks a lot. I learnt many things !
Image

User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Avahi - Zeroconf Networking

Post by damNageHack » 30. Dec 2009, 09:51

First, thanks for your long text of explaining how things will be done well.
prfaasse wrote:What is possible:
- kde (3 and 4, both have support)
- kdegames: kbatteship group play

Salix uses XFCE by default, so I will not support KDE in the standard package, because otherwise the kdelibs are a required dependency.

- pidgin (bonjour chat)

Should be supported. GTK is linked in.

- cups (i managed to get that active once, but i have no operational printer.... :D )
- apache (browse for www-servers...)

What APIs are used? I assume it should work without kde or qt or something strange like that.

- amarok (experimented with mt-daapd: an i-tunes server on your local machine.. almost works...)

No standard installation package for salix. There is exaile (python/gtk).

- ssh/sftp (browse and up/download... )
- vnc

Works out of the box. See the ssh/vnc browsers in menu.
Some applications do not have a 'native' support for avahi/zeroconf: they have no source that 'presents' services for avahi to pass along. But: avahi has a 'cheat-mode', which can be used to export the existence of the services.
Let me see, what is needed by the users in the standard avahi installation. So i will wait for bug reports (feature requests) :lol:
If you'd care to look at the tail of my zenwalk buildfile, you'd find some scripting that sets files so that some services that are enabled in the rc-scripts are 'fake-registered' with avahi. A bit tricky , and not completely 'clean', but better than nothing...
Yes, i saw these patches. But I prefer to go the cleaner way of porting firstly the slackbuilds.org stuff because salix claims to keep to be as compatible to slackware as possible.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.

User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Avahi - Zeroconf Networking

Post by thenktor » 30. Dec 2009, 14:54

Did I get it right, that all these packages have to be build against avahi?
- kde (3 and 4, both have support)
- kdegames: kbatteship group play
- pidgin (bonjour chat)
- cups (i managed to get that active once, but i have no operational printer.... )
- apache (browse for www-servers...)
- amarok (experimented with mt-daapd: an i-tunes server on your local machine.. almost works...)
- ssh/sftp (browse and up/download... )
- vnc

Or do they just need avahi installed to work?

For the first case:
Building avahi will be useless because these are all Slackware packages, that won't be rebuilt. :!:

For the second case:
I don't see why not include Qt4 support then. Avahi and Qt4 are not on the iso, so there is no problem. *troll mode on* And I don't like the whiners that don't install Qt just because it's not gtk :twisted: *troll mode off*
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)

User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Avahi - Zeroconf Networking

Post by damNageHack » 30. Dec 2009, 15:18

Building avahi will be useless because these are all Slackware packages, that won't be rebuilt. :!:
As far as I can understand it now, avahi will itself look for available services as far as it knows about potential existence (compare to the patches in Zenwalk).
I don't see why not include Qt4 support then. Avahi and Qt4 are not on the iso, so there is no problem.
How about qt3? It is also a package (optional) in salix. Qt4 is optional and will be forced if avahi is installed, but also if no qt app otherwise ...
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.

User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Avahi - Zeroconf Networking

Post by thenktor » 30. Dec 2009, 15:38

damNageHack wrote:How about qt3? It is also a package (optional) in salix. Qt4 is optional and will be forced if avahi is installed, but also if no qt app otherwise ...
Qt3 is outdated ;)
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)

Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Avahi - Zeroconf Networking

Post by Shador » 30. Dec 2009, 17:26

To my understanding applications can link with avahi and use it to announce or search services (e.g. mpd and ario, Zenwalk packages were linked with avahi and ario could automagically detect a running mpd instance in the network.).
At the other hand it seems avahi is able to detect available services itself and announces them. I remember I had seen such config files somewhere on Zenwalk. I don't know any details about this.
Image

prfaasse
Posts: 14
Joined: 22. Sep 2009, 18:31
Location: Amsterdam

Re: Avahi - Zeroconf Networking

Post by prfaasse » 30. Dec 2009, 17:30

Enabling Qt3 and/or Qt4 in the avahi build does nothing more than provide Qt-bindings: a Qt-application could interface with avahi. Even with Qt3/4 bindings 'inside', you do not have to install Qt; Noting bad happens to avahi if you generate the bindings, but do not install Qt...

W.r.t. pidgin: i just checked with a bunch of zenwalk-machines: the ones that have a 'native' zenwalk-build of pidgin do support 'bonjour-chat':

Code: Select all

prf[~]$ avahi-browse -a
+ eth0 IPv4 prf@dr200                                     iChat Presence       local
+ eth0 IPv4 prfaasse@dr108                                iChat Presence       local
There is one other (6.2 zenwalk) machine that has a slackware-pidgin: no avahi --> no bonjour / iChat... :D My entire 'local' network is in one room, so there really is not much point in iChatting with myself in the first place :D The machines dr200 and dr108 have less than one metre in between :shock:

The point is: unless an application (such as pidgin) is built to report its services to avahi, there is little chance that avahi -all by itself- will find out that there *is* a service, and zero chance that avahi will 'announce' the service on the local network.

PS: i think that the 'detect by itself' part that Shador is refering to would be mostly due to my 'unclean' and 'manual' trickery :D :

Code: Select all

prf[~]$ ls /etc/avahi/services/
cups.service  disabled/  sftp-ssh.service  ssh.service
The files in /etc/avahi/services are parsed/watched by avahi, and the services described within are 'exported'.
Last edited by prfaasse on 30. Dec 2009, 17:34, edited 2 times in total.
in case of panic: scream and run in circles

User avatar
gapan
Salix Wizard
Posts: 5561
Joined: 6. Jun 2009, 17:40

Re: Avahi - Zeroconf Networking

Post by gapan » 30. Dec 2009, 17:31

Yes, to use avahi, they need to be recompiled with avahi, therefore avahi is useless...
Image
Image

Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Avahi - Zeroconf Networking

Post by Shador » 30. Dec 2009, 17:35

gapan wrote:Yes, to use avahi, they need to be recompiled with avahi, therefore avahi is useless...
No, it definitely isn't, there are other packages provided by use which could use it. I would for example rebuild both ario and mpd for avahi support. They are the only packages I maintain which I know of that they support avahi, but I would also rebuild any other.
So providing avahi would at least give us the possibility to use it with our apps.
Image

Post Reply