• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

Netatalk: changing “Workstation”

pl212

6502
In certain older AppleTalk network visualization software packages such as Trawl and GraceLAN, the machine type (“Macintosh SE/30“) determines what icon is used for a node on a network. By default, netatalk seems to send “Workstation”, and I’m curious if there’s a best practices way to change this?

(This is similar to people with a Synology who want their NAS to show up as an XServe over Bonjour, I suppose… but a few decades older.)
 
Netatalk ships two tools - nbprgstr and nbpunrgstr - that registers and unregisters NBP names on the AppleTalk network, respectively. The technical reason you are seeing the "Workstation" NBP name for your server, is because the particular init script you're using runs nbprgstr after launching atalkd.

The easy way to change this is to re-run nbprgstr with a different NBP name as parameter after atalkd has started up (and probably nbpunrgstr too, in order to get rid of the NBP name you don't want.) The drawback is that you have to do this every time you launch Netatalk.

In order to make a permanent change, you have to modify the init script in question. If you're using the systemd init system, for instance, your atalkd.service unit file will look something like this:

Bash:
[Unit]
Description=Netatalk AppleTalk daemon
Documentation=man:atalkd(8) man:atalkd.conf(5) man:nbp(1)
Documentation=https://netatalk.io/
After=network-online.target

[Service]
Type=forking
GuessMainPID=no
ExecStartPre=/bin/sh -c 'systemctl set-environment ATALK_NAME=$$(hostname|cut -d. -f1)'
ExecStart=/usr/local/sbin/atalkd
ExecStartPost=-/usr/local/bin/nbprgstr -p 4 "${ATALK_NAME}:Workstation"
ExecStartPost=-/usr/local/bin/nbprgstr -p 4 "${ATALK_NAME}:netatalk"
ExecStop=-/usr/local/bin/nbpunrgstr "${ATALK_NAME}:Workstation"
ExecStop=-/usr/local/bin/nbpunrgstr "${ATALK_NAME}:netatalk"
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target

Modify the ExecStartPost and ExecStop lines, then run systemctl daemon-reload, and you should be good to go.

As a side note, Netatalk 2.x can also do the Bonjour Xserve trick if you put "-mimicmodel RackMac" in your afpd.conf. :)
 
Back
Top