Background
The ReadyNAS appliance can use the standard service discovery protocols (Bonjour, UPnP) to advertise the services it offers which can greatly simplify client configuration. While it can easily enable/disable the discovery protocols with the web administration interface, it does not provide a means of customizing the service names.
Because ReadyNAS is based on the Linux operating system, it is able to use the open source solution avahi to handle the service discovery. This service can easily be configured to display alternate names.
Setup
The ReadyNAS system uses a stock template for each service it is able to advertise. When activated, the appropriate template is processed into a service record which is used by the avahi daemon to advertise the various services. In order to effect a persistent change, the template itself must be modified with the desired service name. Directly modifying the service record will result in the changes being lost should the template be reprocessed.
The template 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 only element which is necessary to modify for customizing the displayed name is the <name> element.
The value of the <name> element contains the text of the service advertisement. If the replace-wildcards="yes" attribute is set, the text may include a %h which will automatically be expanded into the hostname. If the replace-wildcards attribute is absent or set to “no”, then no hostname expansion will occur. It is suggested that the names advertise both the hostname and the service in order to avoid confusion.
Here is an example (stock) template for the AFP (Apple Filing Protocol) service:
<?xml version=”1.0″ standalone=’no’?><!–*-nxml-*–>
<service-group>
<name replace-wildcards=”yes”>%h (AFP)</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>
In order to access the necessary configuration files, the EnableRootSSH patch must first be successfully installed.
- Disable both the Bonjour and UPnP discovery services using the ReadyNAS web administration interface.
- Login (via ssh) as “root” to the ReadyNAS appliance.
- Navigate to the configuration directory.
cd /etc/avahi/services - Make a backup of the original configuration file for safety.
cp afp.template afp.template.orig - Edit the
<name>element by replacing the value with the desired text. If thereplace-wildcards="yes"attribute is set, then the hostname will be substituted for a%hin the value text.<name replace-wildcards="yes">AFP on %h</name> - Re-enable the Bonjour and UPnP discovery services using the ReadyNAS web administration interface.