Background
The ReadyNAS appliance can advertise the services available on their system through the Bonjour or UPnP protocols. These service discovery protocols can greatly simplify the client connection and configuration problems. The web administration interface provides an easy method of controlling some of the services advertised, but there may be additional services running on the ReadyNAS that do not have an administrative interface for controlling their advertisement.
Because the ReadyNAS uses the open-source project avahi to handle service discovery, documentation on extending the list of services to be advertised is readily available. With this information, it is relatively easy to create new service records for additional services and simplify the user experience.
Setup
In order to create additional avahi service records, it is necessary to enable root SSH access to the ReadyNAS system.
The service file is a simple XML file which defines a service-group record. The service-group record contains a number of elements which may vary according to the service being advertised. The two essential elements are the name record, which defines the displayed name for the service in question, and the service record, which defines the type, port, and any other connection-related information.
The name element has one possible attribute – replace-wildcards – which can take a value of “yes” or “no”. If the attribute is present and the value is “yes”, then a %h can be used in the value which will be automatically substituted with the host name of the system.
The service element groups together the necessary information for service connectivity. The two most essential elements it contains are the type element and the port element. The type is the is the official service type as defined by RFC 2782 and the port is simply the listening port number.
Depending on the service, there may be additional elements or attributes that are necessary to have a properly formatted service file. Be sure to consult the documentation to ensure the service is properly defined before making any changes.
Example
The following is an example configuration that enables service discovery for SSH:
<?xml version="1.0" standalone='no'?>
<service-group>
<name replace-wildcards="yes">SSH on %h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
To activate this service, perform the following actions:
- Login (via ssh) as “root” to the ReadyNAS appliance.
- Navigate to the configuration directory.
cd /etc/avahi/services - Create a new file named
ssh.servicecontaining the configuration information listed above. - Restart the avahi service to load the new service file.
kill -SIGHUP `ps ax | grep avahi | grep -v grep | awk '{ print $1 }'`