Theme
Mounting SMB/CIFS shares for Syncplify Server! on Linux
The Linux version of Syncplify Server! runs as a set of systemd services, so this article assumes a basic familiarity with Linux and with systemd. Every operation below is performed as root or with sudo.
The idea is simple: have the operating system mount the remote share at boot, before the Syncplify Server! services start, and then point your VFSs at the local mount point.
1. Store the credentials
Prepare a file with the credentials needed to access the SMB/CIFS share. In this tutorial it is /etc/.smbcreds, with this format (and your own credentials, of course):
ini
username=username_to_access_smb_share
password=password_to_access_smb_shareMake it readable by root only:
bash
chmod 600 /etc/.smbcreds2. Create the mount point
Create the directory that will serve as the local mount point for the remote share. For the sake of this example it is /sftpdata:
bash
mkdir /sftpdata3. Create the mount and automount units
Create two files in the systemd configuration directory. Their name does not matter, as long as both files have the same name and exactly the extensions shown here.
File /etc/systemd/system/smbsftpdata.mount:
ini
[Mount]
What=//10.0.5.23/your/remote/share
Where=/sftpdata
Options=credentials=/etc/.smbcreds,noperm,vers=2.1,_netdev
Type=cifsFile /etc/systemd/system/smbsftpdata.automount:
ini
[Unit]
Requires=remote-fs-pre.target
After=remote-fs-pre.target
[Install]
WantedBy=remote-fs.target4. Enable the automount
The last step is to enable the automount, so that the share is mounted automatically at every boot:
bash
systemctl enable smbsftpdata.automountDone. Reboot the operating system, and after the reboot every systemd service, Syncplify Server! included, can reach the contents of the remote SMB/CIFS share through the local mount point /sftpdata. You can now create a Disk VFS whose path is under /sftpdata.
INFO
If you run the worker service under a dedicated account rather than root, as described in the manual's Running the services under dedicated accounts, make sure the mount options give that account read and write access to the share (the uid, gid and file_mode options of mount.cifs).