Could be a legacy of testing some old services. Not sure. Doesn't hurt I guess.There shouldn't be any need to define the local hostname in /etc/hosts, it gets it from /etc/hostname. Also, Netatalk 4 bases the server's name off of the system host name by default.![]()
/usr/local/bin/appletalk-test.sh
root
macipgw
vipw
Good to see a refresh of maciprpi! I'm curious what base OS you're using now?
It's also encouraging to see that you're on a supported and secure release version of netatalk now.
May I ask what it would take for you to migrate to the netatalk 4.x release series? Is there some technical reason holding you back? Please note that the 2.4 release series will receive security patches until September 2025, but after that we plan to EOL it.
A few benefits of netatalk 4.x over 2.4:
- Coexistence with Samba (avoid risk of filesystem metadata corruption)
- AFP 3.4 compliance
- Extended Attributes metadata (more reliable than AppleDouble)
- Bundled and improved macipgw (such as a macipgw.conf configuration file)
- Tons of bug fixes
Ultimately it's your call. But I'm invested in setting you up for success in adopting the latest and best supported version.
[Global]
; Set the server name that appears in the Chooser
servername = MacIPRpi
mimic model = Macintosh
appletalk = yes
uam list = uams_guest.so,uams_clrtxt.so,uams_dhx.so
log file = /var/log/afpd.log
log level = default:maxdebug
[Homes]
basedir regex = /home
[MacIPRpi DISK]
path = /AppleShare
time machine = no
adouble = v1
vol charset = ASCII
guest ok = yes
valid users = guest,@users,nobody
file perm = 0640
directory perm = 0750
#afpd -V
afpd 4.1.1 - Apple Filing Protocol (AFP) daemon of Netatalk
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.
afpd has been compiled with support for these features:
AFP versions: 1.1 2.0 2.1 2.2 3.0 3.1 3.2 3.3 3.4
TCP/IP Support: Yes
AppleTalk Support: Yes
CNID backends: dbd last mysql
Zeroconf support: Avahi
TCP wrappers support: Yes
Quota support: Yes
Admin group support: Yes
Valid shell checks: Yes
cracklib support: Yes
EA support: ad | sys
ACL support: Yes
LDAP support: Yes
D-Bus support: Yes
Spotlight support: Yes
DTrace probes: Yes
afp.conf: /etc/netatalk/afp.conf
extmap.conf: /etc/netatalk/extmap.conf
state directory: /var/local/netatalk/
afp_signature.conf: /var/local/netatalk/afp_signature.conf
afp_voluuid.conf: /var/local/netatalk/afp_voluuid.conf
UAM search path: /usr/local/lib/aarch64-linux-gnu/netatalk/
Server messages path: /var/local/netatalk/msg/
root@maciprpi:~# cat /etc/systemd/system/macipgw.service
[Unit]
Description=MacIP Gateway Service systemd and IPtables adjustments
After=network.target
Requires=network.target
[Service]
Type=simple
ExecStart=/usr/local/sbin/macipgw -n 8.8.8.8 172.16.2.0 255.255.255.0
ExecStartPost=/bin/sh -c /usr/sbin/iptables-restore < /etc/iptables-save
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Global]
network = 172.16.2.0
netmask = 255.255.255.0
nameserver = 8.8.8.8
Great! I very much appreciate this review before going live. It all works… but a optimal config is better! Thanks for the tip about macipgw too. I will adjust it in the new beta03 with Netatalk 4.1.1.
….something else. I also try to have afpfs-ng on board. Which version should I use and what guideline to install/compile I should follow?
mkdir /tmp/afp
mount_afp "afp://localhost/MacIPRpi DISK" /tmp/afp
Mounting MacIPRpi DISK from localhost on /tmp/afp
Mounting of volume MacIPRpi DISK from server maciprpi succeeded.
AFP share mounted successfully on /tmp/afp.
echo "Fixing the 'full_url' multiple definition error..."
sed -i 's/^int full_url;/extern int full_url;/' ./cmdline/cmdline_afp.h
I wonder if you're still using Simon's fork here by mistake?Wowww. Great! You maintain it yourself!
I'm very glad you do. I'm now using the code of Simon Vetter. I works, but it is very old. I will start testing with your code.
About fuse. I compile afpfs-ng direct without any change and install libfuse-dev. I then can mount stuff on the localhost ( just to test)
Code:mkdir /tmp/afp mount_afp "afp://localhost/MacIPRpi DISK" /tmp/afp Mounting MacIPRpi DISK from localhost on /tmp/afp Mounting of volume MacIPRpi DISK from server maciprpi succeeded. AFP share mounted successfully on /tmp/afp.
I also need to adjust some thing in the code so it compiles:
Code:echo "Fixing the 'full_url' multiple definition error..." sed -i 's/^int full_url;/extern int full_url;/' ./cmdline/cmdline_afp.h
root@maciprpi:~# mkdir /tmp/afp
root@maciprpi:~# mount_afpfs "afp://localhost/MacIPRpi DISK" /tmp/afp
The afpfs daemon does not appear to be running for uid 0, let me start it for you
Mounting MacIPRpi DISK from localhost on /tmp/afp
fuse version=29 args={'maciprpi:MacIPRpi DISK','/tmp/afp','-f','-osubtype=afpfs,fsname=@maciprpi:MacIPRpi DISK'}
Mounting of volume MacIPRpi DISK from server maciprpi succeeded.
root@maciprpi:~# afpgetstatus localhost
AFP response from localhost:548 via IPv6
Attempting connection to ::1 ...
Server name: maciprpi
Server type: Netatalk4.1.1
AFP versions:
AFP2.2
AFPX03
AFP3.1
AFP3.2
AFP3.3
AFP3.4
UAMs:
No User Authent
Cleartxt Passwrd
DHCAST128
Flags:
SupportsCopyFile
SupportsServerMessages
SupportsServerSignature
SupportsTCP/IP
SupportsSrvrNotifications
SupportsOpenDirectory
SupportsUTF8Servername
SupportsUUIDs
SupportsExtSleep
SupportsSuperClient
Signature:
a9 31 26 2c 26 03 66 89 cc 46 0d f1 4d aa 82 3d
.1&,&.f..F..M..=
Resolved IPv6 address: ::1
Resolved IPv4 address: 127.0.0.1
#####
# ##
##### # #
# ## ### ####
##### # # # # #
# ## ### # ##########
##### # # ##### # #
# ## ### ####### #### #
# # # ### ### # #
# #### #### ### ###### #
# # #### # #### # #
# # ### ## # # # #
# # ##### ## ####
# # ##### ### #
# ###### # ### #
# # ### # #
######## ##### # ########
#### #
##############################
# #
##########################
# #
# #
###
# #
# # ######### # ########## # #
# #
# # ########## ########### # #
So this will be the new:@mactjaap Well done getting this far with the migration! A few comments on your afp.conf:
> [Global]
> ; Set the server name that appears in the Chooser
> servername = MacIPRpi
> mimic model = Macintosh
> appletalk = yes
> uam list = uams_guest.so,uams_clrtxt.so,uams_dhx.so
You would want to add "uams_dhx2.so" as well for modern macOS clients.
> log file = /var/log/afpd.log
> log level = default:maxdebug
The "maxdebug" log level will generate a humongous amount of logs. In this case, "info" is a better log level I think.
> [Homes]
> basedir regex = /home
>
> [MacIPRpi DISK]
> path = /AppleShare
> time machine = no
> adouble = v1
netatalk4 doesn't support AppleDouble v1. Besides, you would want to use EA anyways. I suggest you remove this line and let netatalk use the default.
> vol charset = ASCII
It is strongly recommended to use the default UTF8 instead. Don't even think netatalk4 supports a plain ASCII charset.
> guest ok = yes
This is not a supported option in netatalk4.
> valid users = guest,@users,nobody
> file perm = 0640
> directory perm = 0750
Are the perm settings having the effect you want? In my experience these two options are buggy. I think it's better to chown the shared volume dir to the users group, add all relevant users to this group, and then use default permissions.
Regarding the macipgw systemd service:
> ExecStart=/usr/local/sbin/macipgw -n 8.8.8.8 172.16.2.0 255.255.255.0
In netatalk4.1 I introduced a macipgw.conf file where you can configure this without messing with the service file.
For your example, the macipgw.conf file should look like this:
Code:[Global] network = 172.16.2.0 netmask = 255.255.255.0 nameserver = 8.8.8.8
[Global]
; information about config
; https://netatalk.io/4.0/htmldocs/afp.conf.5
; Set the server name that appears in the Chooser
servername = MacIPRpi
mimic model = Macintosh
appletalk = yes
; add "uams_dhx2.so" as well for modern macOS clients.
uam list = uams_guest.so,uams_clrtxt.so,uams_dhx.so,uams_dhx2.so
log file = /var/log/afpd.log
; log level normal
log level = default:info
; debug or different: loglevels: severe, error, warn, note, info, debug, debug6, debug7, debug8, debug9, maxdebug
; log level = default:maxdebug
[Homes]
basedir regex = /home
[MacIPRpi DISK]
path = /AppleShare
time machine = no
vol charset = UTF8
valid users = guest,@users,nobody
; Deprecated: These permission settings are buggy and not recommended.
; file perm = 0640
; directory perm = 0750
root@maciprpi:~# chooser.pl
Found AppleTalk AFP Server: maciprpi at 65280.24 (Port: 133)
Found AppleTalk AFP Server: BasiliskII at 65280.123 (Port: 249)
Available AFP Servers:
[1] maciprpi (65280.24:133)
[2] BasiliskII (65280.123:249)
Choose a server (1-2): 2
Username: macipgw
Password: macipgw
Fetching available volumes for BasiliskII...
Available Volumes on BasiliskII:
[1] mac76sys
[2] 200MB DATA
[3] 76-DATA-DISK
[4] MAC76-200MB
[5] BIGDISK1GB VOL
[6] BACKUP1GB
[7] BACKUP2-Van-Quadra-ETC-500M
[8] System 7.1 20MB
[9] HDBACKUP-SE-7.01
[10] OpenRetroSCSI
Choose a volume (1-10):
root@maciprpi:~# papd-test.sh
Print mode disabled. Only checking printer status.
Searching for available AppleTalk printers...
Found AppleTalk printers:
HP LaserJet Pro M118dw 6071AC
Checking status of "HP LaserJet Pro M118dw 6071AC"... Available
Skipping print job for "HP LaserJet Pro M118dw 6071AC".
root@maciprpi:~# papd-test.sh --print
Print mode enabled.
Searching for available AppleTalk printers...
Found AppleTalk printers:
HP LaserJet Pro M118dw 6071AC
Checking status of "HP LaserJet Pro M118dw 6071AC"... Available
Sending enhanced PostScript test print to "HP LaserJet Pro M118dw 6071AC"...
Trying 65280.214:134 ...
status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ;
%%[ status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ; ]%%
Connected to HP LaserJet Pro M118dw 6071AC:LaserWriter@*.
%%[ status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ; ]%%
%%[ status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ; ]%%
%%[ status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ; ]%%
%%[ status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ; ]%%
%%[ status: idle; info: "HP_LaserJet_Pro_M118dw_6071AC" is ready ; ]%%
Connection closed.
Print job sent successfully.
root@maciprpi:~# mount_afpfs "afp://localhost/MacIPRpi DISK" /tmp/afp
The afpfs daemon does not appear to be running for uid 0, let me start it for you
Mounting MacIPRpi DISK from localhost on /tmp/afp
fuse version=29 args={'maciprpi:MacIPRpi DISK','/tmp/afp','-f','-osubtype=afpfs,fsname=@maciprpi:MacIPRpi DISK'}
Mounting of volume MacIPRpi DISK from server maciprpi succeeded.
root@maciprpi:~# afpgetstatus localhost
AFP response from localhost:548 via IPv6
Attempting connection to ::1 ...
Server name: maciprpi
Server type: Netatalk4.1.1
AFP versions:
AFP2.2
AFPX03
AFP3.1
AFP3.2
AFP3.3
AFP3.4
UAMs:
No User Authent
Cleartxt Passwrd
DHCAST128
Flags:
SupportsCopyFile
SupportsServerMessages
SupportsServerSignature
SupportsTCP/IP
SupportsSrvrNotifications
SupportsOpenDirectory
SupportsUTF8Servername
SupportsUUIDs
SupportsExtSleep
SupportsSuperClient
Signature:
a9 31 26 2c 26 03 66 89 cc 46 0d f1 4d aa 82 3d
.1&,&.f..F..M..=
Resolved IPv6 address: ::1
Resolved IPv4 address: 127.0.0.1
Usage: check-maciprpi.sh [options]
Options:
-a Run all tests except --print-page
--help Display this help message
--webone Check WebOne Proxy
--url Test URLs
--services Check required services
--packages Installed packages
--tftp Test TFTP functionality
--afpfs-ng Test afpfs-ng mount
--afp-perl Check afp-discover.pl
--httpd Check if the HTTPD homepage is accessible
--print Test print status
--print-page Send a real print job
--ports Test ports
--samba Test Samba
--tcpdump Test tcpdump to tun0, the 172.16.2.0/24 network
--all Run all tests including --print-page
--all-no-print Run all tests except --print-page (same as -a)
Example: check-maciprpi.sh --webone --tftp
Example: check-maciprpi.sh -a