Avahi (Debian/Raspbian)

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Avahi (Debian/Raspbian)

Post by ^rooker »

[PROBLEM]
Seems the world is taking the "Zero" in "Zero-Configuration" very serious:
Finally, I seem to have found at least ONE resource of information for how to f***ing configure Avahi services! :evil:
Thanks, Noah.org!

Links:
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Re: Avahi (Debian/Raspbian) [SOLVED]

Post by ^rooker »

[SOLUTION]

I wasn't able to figure out who generates the files in /etc/avahi/services, or where they are installed from. They just seem to "appear" - but there's no information found on the Internet that would explain which process created them.
Mysterical...

Anyways, I was able to recover existing .service files from an older installation of raspbian (wheezy).
I simply copied them over to the "/etc/avahi/services" folder and restarted the avahi-daemon:

Code: Select all

$ service avahi-daemon restart
Below are some example .service files from my setup:

cups.service:

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>
  <name replace-wildcards="yes">Printer configuration on %h</name>

  <service>
    <type>_http._tcp</type>
    <port>631</port>
    <txt-record>path=/printers/HP_LaserJet_P1102w</txt-record>
  </service>
</service-group>
http.service

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>
  <name replace-wildcards="yes">Webserver on %h</name>

  <service>
    <type>_http._tcp</type>
    <port>80</port>
    <txt-record>path=/media_catalog/</txt-record>
  </service>
</service-group>
smb.service

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>
  <name replace-wildcards="yes">Fileserver on %h</name>

  <service>
    <type>_smb._tcp</type>
    <port>445</port>
    <txt-record>path=browse</txt-record>
  </service>
</service-group>
ssh.service

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<!--
  This file is part of avahi.
 
  avahi is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2 of the
  License, or (at your option) any later version.

  avahi is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with avahi; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  02111-1307 USA.
-->

<!-- See avahi.service(5) for more information about this configuration file -->

<service-group>

  <name replace-wildcards="yes">%h</name>

  <service>
    <type>_ssh._tcp</type>
    <port>22</port>
  </service>

</service-group>
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply