Upgrade Samba to add Time Machine support

345 views
Skip to first unread message

Alex Khroustalev

unread,
Feb 23, 2020, 5:16:46 AM2/23/20
to Alt-F
Hello.

João, I think it's a question primarily to you. 

Is it possible to compile/upgrade Samba to the latest version (4.11.6 as of today)? Alt-F 1.0 has Samba 3.6.5 and since ver. 4.8.0 Time Machine support was added (https://www.samba.org/samba/history/samba-4.8.0.html). 

Is it possible to recompile Samba package (or Alt-F altogether) to add MacOS backup capabilities? Currently TM on my DNS-327L works over AFP which is known to produce errors and to corrupt backup images.

Best regards,
Alex

João Cardoso

unread,
Feb 24, 2020, 1:50:13 PM2/24/20
to Alt-F


On Sunday, 23 February 2020 10:16:46 UTC, Alex Khroustalev wrote:
Hello.

João, I think it's a question primarily to you. 

Is it possible to compile/upgrade Samba to the latest version (4.11.6 as of today)?

I'm afraid not, as it is too big and will not fit the available flash memory on the DNS-323/321.
Of course I could cross-compile it as an on-disk package, but the amount of dependencies (i.e., the number of packages that I would need to also cross-compile) is huge; on my linux box, that's 132 packages! by contrast, the Alt-F version depends only on 12.

Entware has samba-4.11.2, but you would have to install it manually, as the Alt-F Entware webUI uses  Entware-ng.
See https://github.com/Entware/Entware/wiki

Alex Khroustalev

unread,
Mar 2, 2020, 3:06:16 PM3/2/20
to al...@googlegroups.com

Thanks João.

I'll try Entware, but still, would you be so kind to compile Samba as an on-disk package since it seems to be a much more elegant solution?

Best regards,
Alex
--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alt-f/2374d7e8-d8d4-4cfc-9603-2e6f52e8e6c2%40googlegroups.com.

Alex Khroustalev

unread,
May 21, 2020, 4:46:41 PM5/21/20
to 'Alex Khroustalev' via Alt-F
João, thanks for the advice, I’ve installed Samba from Entware and got Time Machine working properly. 

But I've encountered some usabiliy issues. 

1. I’ve disabled netatalk daemon since it’s no longer needed (MacOS uses SMB by default).

2. Made a few modifications to /etc/init.d/S61smb script:
a. Changed executables paths to /opt/sbin (tried also to move /opt/sbin to the beginning of $PATH variable and symlinking /opt/sbin/smbd to /usr/sbin/smbd to no avail)
b. Added “-s /opt/ets/sama/smb.conf” to $SMB_OPTS
c. Added "avahi add afpovertcp” to istart(). This is needed for Mac to list NAS in Finder's side menu.

3. Everything works fine if I manually launch /etc/init.d/S61smb.

4. If however I let SMB launch automatically after reboot it won’t start properly: 
a. After reboot I don’t get “smb.service-“ and “afpovertcp.service-“ enabled. I need to restart the service.
b. Seems like it starts the old alt-f version of smb instead of the new one. 

5. WEB gui won’t detect S61smb is launched if I change executables to /opt/sbin/smbd and /opt/sbin/nmbd. It shows “stopped” all the time. 

What am I doing wrong?

Alex

Alex Khroustalev

unread,
May 22, 2020, 7:01:00 AM5/22/20
to 'Alex Khroustalev' via Alt-F
Ok, i figured almost everything out.

1. I’ve symlinked /opt/sbin/smbd and /opt/sbin/nmbd top /usr/sbin/smbd_4 and /usr/sbin/nmbd_4
2. Created a new init.d script S99smb_4 to start samba 4 from /opt with /opt/etc/samba/smb.conf as config file.
3. Changed port from 139 to 445 in /etc/avahi/services/smb.service since MacOS won’t connect to old smb port.

Now I’ve got Samba 4 started properly on NAS and Time Machine functioning over smb.

To add NAS icon to sidebar one have two options:
1. Get netatalk launched on boot with all shares disabled.
2. (a) Change port from 548 to 445 in /etc/avahi/services/afpovertcp.service and (b) add  ‘avahi add afpovertcp’ / 'avahi remove afpovertcp' lines to S99smb_4 script. (a) Is needed to bypass avahi’s check for open ports and (b) to have S99smb_4 relaunched properly after boot.

I prefer the second one since it doesn’t require an additional daemon running.

The need for such a trick is due to S50avahi_daemon is launched after S99smb_4. S50avahi_daemon init.d script checks for open ports on start and when it sees that afp’s port 548 is closed it renames afpovertcp.service to afpovertcp.service-


If anyone is interested, I’ve attached my config files. 
Additional lines in .service files make the NAS look like Time Capsule in Finder. 

afpovertcp.service
smb.service
S99smb_4
smb.conf
Reply all
Reply to author
Forward
0 new messages