Tuesday, 19 November 2013

Working with Avahi TXT Records

This post is part of my ongoing project to create an Avahi configuration package for Pidora Linux. My last post detailed my decision to exclude domain configuration from my package.

In this post, I will detail my experiences with populating the two TXT records associated with services found on Pidora Linux (both dealing with SSH). The two services found on a Pidora Linux are SSH and Udisks (which is accessed via SSH. The goal of my autoconfiguration script in relation to these service will be to populate the TXT record to describe these services better. Currently, the services are advertised without TXT records.

I will add TXT records in which the user can specify the SSH username and password to help a user login. By using this sed command I should be able to accomplish what I want to.
sed -e '/<type>_ssh._tcp<\/type>/a \     <txt-record>Username=Blank<\/txt-record>\n     <txt-record>Password=Blank<\/txt-record>' /etc/avahi/services/ssh.service > /etc/avahi/services/ssh.service.tmp && mv -f /etc/avahi/services/ssh.service.tmp /etc/avahi/services/ssh.service

sed -e '/<type>_udisks-ssh._tcp<\/type>/a \     <txt-record>Username=Blank<\/txt-record>\n     <txt-record>Password=Blank<\/txt-record>' /etc/avahi/services/udisks.service > /etc/avahi/services/udisks.service.tmp && mv -f /etc/avahi/services/udisks.service.tmp /etc/avahi/services/udisks.service

The next step of this portion of the project would be to detect certain common service run off the Pi (such as vsftpd, httpd, etc.) and create service records for them. Given the amount of time I spent packaging Avahi and nss-mdns, I am unsure as to whether this functionality will be possible given my deadline.

For the next poriton of my project as a whole, I will be writing a command to open iptables to Avahi and beginning to crate my spec file for my package.


Post a Comment