Advertising Linux Services via Avahi/Bonjour

Update: most of this information is still correct but an update for combining service definitions into one file and setting an icon is available here: https://holyarmy.org/2008/11/bonjour-avahi-addendum

In my last post I outlined how I followed others’ directions to enable netatalk on Linux and Time Machine backups to a shared AFP folder. Originally, I also described how to put all your shares on netatalk. I suppose if only have Mac clients or you REALLY want to use AFP, you can do so. As I worked with files over AFP shares, I started noticing that the performance seemed to be quite bad. No, I didn’t benchmark, but copying large video files to a shared folder over my gigabit network was substantially slower over AFP (netatalk) than over CIFS/SMB (samba). I use my network shares pretty heavily, so this was a concern. Also, netatalk tries very hard to replicate an HFS filesystem complete with resource fork support. This means that your shared directories end up with lots of extra folders named “.AppleDouble”(and a few others) containing Mac specific info. (Note: even on CIFS you’ll get the “.AppleDB” folders unless you disable a setting in Finder. I can deal with .AppleDB better than .AppleDouble AND .AppleDB) So, because of these two issues I decided to try using CIFS and samba again.

My first experiment was to try sharing a “time_machine” folder via CIFS, and using the “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1” hack on the previous post, I was able to get Time Machine to perform a backup. It worked, but in the end I decided that if I need to restore from this backup, I want my resource forks intact. To do that, I need AFP and netatalk. So, I removed all AFP shares except the one for Time Machine backup share. Now my Time Machine would backup and restore happily, and I could again use my Samba shares.

One of the cool things about having used AFP/netatalk was that my server and folders were showing up in my finder window. Well, that’s not a feature of AFP or netatalk, its actually avahi/Bonjour doing that. So, all I had to do was advertise the services. If you followed my previous posts, you’ve already created a service for AFP/netatalk on your server; it’s simple to create more, just add more service files. I’ll paste in all of my service files here:

/etc/avahi/services/aftp.service/

afpd.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h AFP</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

apache.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h HTTP</name>
<service>
<type>_http._tcp</type>
<port>80</port>
</service>
</service-group>

rfb.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h VNC</name>
<service>
<type>_rfb._tcp</type>
<port>5901</port>
</service>
</service-group>

samba.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>_smb._tcp</type>
<port>139</port>
</service>
</service-group>

sftp.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h SFTP</name>
<service>
<type>_sftp-ssh._tcp</type>
<port>22</port>
</service>
</service-group>

ssh.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h SSH</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>

So, you can see that I’m announcing Samba/CIFS file, AFP file, Apache HTTPd, VNC (RFB) Remote Desktop, SSH and SFTP services. Leopard’s Finder only displays the CIFS, AFP and RFB services, but other applications with Bonjour support will see the other services. By default Finder opens “Screen Sharing” when you use the advertised service, but Chicken of the VNC can also browse for Bonjour enabled VNC servers. Below are screen shots of my Finder showing the shared services.

finder_bonjour_vnc.jpg
finder_bonjour_cifs.jpg
finder_bonjour_cifs.jpg

No restarts are needed for anything at this point. The services should automatically be picked up by the Linux avahi daemon, but if you really need to, you may execute /etc/init.d/avahi-daemon restart .

canadian viagra levitra generic escitalopram side effects cialis pricing acyclovir 200mg thuoc azithromycin viagra samples cialis coupons 2017 viagra without a doctor prescription usa levitra 20mg cilias zovirax for cold sores ciprofloxacin ophthalmic solution ciprofloxacin hcl 500 mg side effects how to take cialis viagra costs cialis pharmacy prices generic cialis levitra coupons how to wean off lexapro without withdrawals cialis 20mg side effects of azithromycin 250 mg what is acyclovir used for lexapro side effects in men how to wean off lexapro acyclovir for shingles side effects of finasteride does lexapro cause weight gain cheap levitra cipro dosage zovirax dosage how long does viagra last cipro revatio vs viagra viagra without a doctor prescription zithromax levitra 20 mg what is acyclovir for generic cialis at walmart ciprofloxacin viagra sans ordonnance lexapro online cialis side effects of ciprofloxacin 500 mg finasteride side effects in men what does azithromycin treat how does cialis work effects of stopping finasteride viagra for men lexapro 10mg cipro antibiotics cialis prices acyclovir dosing cialis coupons from manufacturer how much does cialis cost finasteride dosage cipro uses what does viagra do viagra for women finasteride effets secondaires viagra ciprofloxacin hcl 500 mg tab cialis professional viagra for sale viagra dosage lexapro dosing cialis 30 day sample finasteride hair loss ciprofloxacin dosierung finasteride finasteride efectos secundarios lexapro 5mg buy levitra online tamoxifen langzeitfolgen viagra 100 mg levitra rezeptfrei deutschland cialis pills cialis 30 day trial coupon tamoxifen bijwerkingen acyclovir 800 mg tamoxifen and foods to avoid how long for lexapro to work free cialis side effects of ciprofloxacin finasteride 5 mg tab cialis dosage viagra tesco tamoxifen lawsuits zovirax pills tamoxifen viagra vs cialis how does lexapro work what bacteria does ciprofloxacin kill ciprofloxacin 500mg tablets cialis free trial acyclovir ointment online viagra tamoxifen citrate levitra coupon azithromycin 500 ciprofloxacin class cialis 20mg directions what is tamoxifen used for viagra 100mg tablets retail price effects of stopping lexapro suddenly lowest cialis prices is azithromycin acyclovir medication levitra erfahrungen viagra tablets lexapro vs zoloft levitra vs viagra lexapro para que sirve viagra effects free viagra azithromycin uses is ciprofloxacin a penicillin finasteride results cialis coupons buy viagra online lexapro side effects men azithromycin 250 buy cialis vardenafil 20mg cipro side effects in elderly azithromycin pregnancy category azithromycin eye drops generic lexapro what is ciprofloxacin azithromycine 250 mg what infections does ciprofloxacin treat acyclovir side effects lexapro reviews levitra vs viagra for hardness lexapro manufacturer website lexapro overdose azithromycin 5 day dose pack side effects of acyclovir cialis generic availability lexapro dosage where to buy viagra viagra generico herbal viagra tamoxifen nebenwirkungen cialis side effects cialis samples ciprofloxacin 500 mg lexapro and wellbutrin combination therapy zoloft vs lexapro canada viagra ciprofloxacin side effects in women viagra cialis cialis samples overnight cialis tadalafil cipro side effects azithromycin vs erythromycin propecia side effects cipro dangers cialis dosage strengths cialis alternative azithromycin cost erectile dysfunction cialis cialis generic finasteride tablets generic viagra 100mg viagra coupon zovirax cream side effects of finasteride 5mg viagra for sale uk azithromycin for strep throat side effects of lexapro viagra wiki finasteride for hair loss viagra coupons viagra 100 viagra online stopping lexapro escitalopram 10 mg cialas viagra ohne rezept aus deutschland ciprofloxacin uses escitalopram 10 mg para que sirve is lexapro a controlled substance how does viagra work viagra from canada what is lexapro used for viagra pillen kruidvat generic viagra viagra pill what is acyclovir generic for cialis azithromycin 250mg cialis reviews side effects of azithromycin viagra sex azithromycin pediatric dosing viagra generic cialis dosage recommendations viagra canada lexapro vs wellbutrin cialis without a doctor’s prescription tamoxifen interaction ciprofloxacin dosage cialis 5 mg viamedic cialis lexapro side effects ciprofloxacin 500mg azithromycin for uti lexapro and weight loss cialis cheap levitra 10 mg prezzo buy generic viagra cialis daily azithromycine eg 500 mg bijsluiter viagra vs cialis vs levitra azithromycin dosage viagra bestellen generic cialis tadalafil cialis vs viagra ciprofloxacin hydrochloride ophthalmic buy levitra what is azithromycin azithromycin liquid viagra 100mg viagra nebenwirkungen cialis patent expiration finasteride reviews cialis patent expiration 2017 side effects of cialis sex viagra for women acyclovir for cold sores ciprofloxacin hydrochloride escitalopram 10mg cialis from canada levitra prezzo in farmacia canada cialis cipro drug class escitalopram effets secondaires lexapro and weight gain viagra en ligne livraison 24h cialis 20 mg cialis coupon 20 mg what is azithromycin used for equipe argentine viagra viagra cost viagra price azithromycin side effects azithromycin 500 mg what is lexapro what works better than viagra azithromycin drug class ciprofloxacin side effects after age 60 celexa vs lexapro how to use viagra cipro and tendonitis utilisation viagra first few days on lexapro viagra pills weaning off lexapro lexapro generic name cialis on line finasteride 5mg side effects cipro 500 ciprofloxacin used for levitra 20 mg von bayer azithromycin without a doctor’s prescription tamoxifen cost discount viagra finasteride 5mg side effects mayo clinic finasteride medication azithromycin 250 mg cialis canadian pharmacy escitalopram nebenwirkungen is azithromycin penicillin cealis finasteride long term effects common side effects of ciprofloxacin 500 mg lexapro withdrawal cialis price azithromycin coverage acyclovir dosage what is cialis 9 levitra at walmart viagra vs cialis vs levitra acyclovir dosage for cold sores ciprofloxacin bnf cialis savings card lexapro side effects in women cialis canada cipro antibiotic levitra 20mg cost per pill vardenafil vs viagra cialis cost cialis online lexapro coupons natural viagra lexapro 10 mg finasteride permanent side effects discount cialis cialis otc viagra soft viagra single packs zithromax dosage what does ciprofloxacin treat acyclovir cream azithromycin three times a week what is cipro usually prescribed for viagra prices tamoxifen side effects in women azithromycin 500 erfahrungen ciprofloxacin coverage what is cipro used for ciprofloxacin side effects liquid cialis azithromycin 250 mg treatment azithromycin 250mg tablets 6 pack ciprofloxacin spc cialis pills for sale zovirax viagra on line no prec azithromycin tablet tamoxifen therapy lexapro bula finasteride 5 mg cialis medication ciprofloxacin dose viagra alternative ciprofloxacin drops escitalopram oxalate azithromycin class what is azithromycin for acyclovir 800 mg 5 times a day 200 cialis coupon ciprofloxacin 250 mg finasteride 5mg cialis coupons printable ciprofloxacin 500 mg for urinary tract infection finasteride 5mg tab cialis effects escitalopram 20 mg wellbutrin and lexapro generic for lexapro nolvadex viagra uk ciprofloxacin hcl 500 mg cialis azithromycin tablets cipro for uti side effects of lexapro in women cialis voucher what is tamoxifen propecia buy generic levitra levitra prices what does ciprofloxacin 500mg treat ciprofloxacin drug class ciprofloxacin nebenwirkungen lexapro and weight gain in women levitra 20 mg precio farmacia tamoxifen side effects in women over 55 ciprofloxacin 500mg antibiotics tamoxifen and weight gain acyclovir lexapro withdrawal symptoms withdrawal from lexapro azithromycin cialis coupon print finasteride 1mg levitra 20 mg cost walmart buy viagra side effects of viagra what is lexapro for side effects of tamoxifen zithromax 500 mg daily cialis female viagra zithromax antibiotic lexapro dosages cialis vs viagra post finasteride syndrome is tamoxifen chemotherapy how long for azithromycin to take effect pfizer viagra coupons from pfizer tamoxifen and bone pain cialis for women zithromax z-pak azithromycin z pak what is ciprofloxacin prescribed for cialis testimonials what is finasteride acyclovir 800 mg for shingles generic levitra finasteride side effects generic levitra vardenafil 20mg what is finasteride used for cialis sample azithromycin pregnancy cialis coupon cialis generic tadalafil viagra tablet azithromycine finasteride for women escitalopram viagra wikipedia viagra kaufen women viagra how to get off lexapro acyclovir 400 mg acyclovir ointment 5 cialis copay card viagra 50mg lexapro medication acyclovir vs valacyclovir levitra bayer 20mg meilleur prix viagra ohne rezept auf rechnung lexapro generic buying viagra cialis website cyalis azithromycin and alcohol side effects lexapro viagra natural levitra cialis for daily use acyclovir dose cialis for men azithromycin for pneumonia levitra online tamoxifen side effects viagra vs cialis cialis for sale ciprofloxacin hcl order viagra finasteride and enlarged prostate viagra substitute lexapro vs celexa price cialis when will cialis go generic what is cipro cialis patent expiration date extended cialis for bph viagra alternatives what is viagra viagra receptfritt acyclovir 400mg viagra on line azithromycin medscape antibiotic ciprofloxacin lexapro benefits for women canadian cialis viagra medicine lexapro 20mg cheap viagra finasteride vs dutasteride levitra dosage what is ciprofloxacin used for ciprofloxacin 500 cialis 10 mg cialis trial cialis 5mg daily best price viagra ciprofloxacin 500mg antibiotics side effects ciprofloxacin 500 mg tabletten viagra side effects ciprofloxacin for dogs cost of cialis ciprofloxacin 250mg wholesale cialis how does acyclovir work sophia viagra ciprofloxacin eye drops cheap cialis cialis 5mg pfizer viagra side effects of lexapro 10 mg levitra vs viagra cost of viagra over the counter viagra cialis or viagra viagra activate what does finasteride do zovirax ointment what is escitalopram acyclovir 800mg lexapro weight gain azithromycin 500mg buy cialis online lexapro for anxiety levitra without a doctor prescription cialis discount

17 thoughts on “Advertising Linux Services via Avahi/Bonjour

  1. Actual mac servers combine all the services into one service group with the same name. This lets the leopard finder combine like services into one icon. This is most apparent when you have afp, samba (avahi), and samba broadcasting its NetBIOS name. If you make them all one service group with the same name (same as the NetBIOS name ‘%h’) The Leopard finder will show only one icon and preferentially use afp over samba over finding samba via NetBIOS.

    Also you can specify your finder icon for a service group like so:
    http://www.simonwheatley.co.uk/2008/04/06/avahi-finder-icons/

Leave a Reply

Your email address will not be published. Required fields are marked *