Netatalk / netatalk

Netatalk is a Free and Open Source AFP fileserver. A *NIX or BSD system running Netatalk is capable of serving many Macintosh clients simultaneously as an AppleShare file server.
https://netatalk.io
GNU General Public License v2.0
353 stars 87 forks source link

Ensure all init scripts are updated for AppleTalk support. #1547

Closed NJRoadfan closed 1 month ago

NJRoadfan commented 1 month ago

Netatalk 2.x tended to use monolithic init scripts to start up all the various services. One thing that guaranteed was that atalkd (if installed) was loaded before afpd, which allowed file sharing over AppleTalk to function. So far, only the systemd scripts have been updated to support this. The OpenRC scripts can likely support this by adding use atalkd in the depend() section of the openrc.netatalk script. The NetBSD scripts appear the same as Netatalk 2.x and likely need no changes. Do FreeBSD, OpenBSD, and Solaris still have working AppleTalk support?

rdmark commented 1 month ago

FreeBSD and OpenBSD sadly both did away with their appletalk kernel modules about a decade ago. I made a note of this in the AppleTalk README: https://github.com/Netatalk/netatalk/blob/main/doc/README.AppleTalk

On Solaris we used to depend on the kernel module that was distributed with the netatalk codebase. We removed it from 2.x a few months ago in https://github.com/Netatalk/netatalk/issues/781 because it was hopelessly bitrotted (and SPARC architecture only.)

I'm still holding out hope that we will see a userland appletalk stack in our lifetime. :)

rdmark commented 1 month ago

Found a few more shortcomings and bugs while testing on Alpine (OpenRC) and Debian (sysv). Addressing all in the PR.

One interesting observation is that nbpunrgstr has a quirk in that when you attempt to unregister a non-existent nbp entry it returns the generic error. This is not ideal for shell scripting, e.g. the OpenRC init script. It becomes impossible to shut down atalkd if the nbpunrgstr steps fail. I added || true to those lines as a workaround. But at the same time, I don't know if it's even appropriate or necessary to unregister those entries. What do you think?

NJRoadfan commented 1 month ago

They aren't needed. Once atalkd terminates, all NBP registrations vanish.

rdmark commented 1 month ago

Fixed.