ZFS rsync can't make socket

I'm trying to rsync some files from another FreeBSD 10.2 machine (from UFS) to the local ZFS filesystem and always getting an error.

Code:
rsync: mknod "/usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack/p0f.socket" failed: File name too long (63)

rsync to the local UFS disk works which makes me to thing that ZFS can't handle sockets? But how does ZFS works for / then?
 
The actual error message does not tell, that it is not able to handle the socket, but that rsync found a "File name too long (63)". I am not very familiar with rsync, however, I can imagine that there could be a setting somewhere which would increase the maximum possible path length. Another possibility to avoid this error could be to abbreviate some of the intermediate directories of the given path, e.g. /usr/zfs/bkp/bltsft.com/bkp/icrm/...

Anyway, it doesn't make so much sense to backup the sockets, since these file system items are managed by the system on the fly, and therefore there should be no need to either backup or restore local-domain sockets.
 
Well, maybe it is rather an academic experiment, but… If I set local destination to UFS with the exactly same source and data, everything works perfect. This is what makes me to think that problem is in ZFS rather than rsync.
 
Well, maybe it is rather an academic experiment, but… If I set local destination to UFS with the exactly same source and data, everything works perfect. This is what makes me to think that problem is in ZFS rather than rsync.
Perhaps rsync becomes confused by ZFS error codes, and "File name too long (63)" is really meant to be "File system item is a socket, and it cannot be copied (63)". What happens, if you test copying the item p0f.socket from its origin to /usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack/p0f.socket, using the cp command?

For example, if I try to copy the socket of my PostgreSQL server to some place, I see:
Code:
# cp /tmp/.s.PGSQL.5432 ~/.s.PGSQL.5432
cp: .s.PGSQL.5432 is a socket (not copied).

# ls -l /tmp/.s.PGSQL.5432
srwxrwxrwx  1 pgsql  wheel  0 14 Okt 09:03 /tmp/.s.PGSQL.5432
Note the 's' (which means socket) in front of the access rights of that file system item. Anyway, it is absolutely normal, that sockets would/should not be copied by any user land commands, and the same holds for other file system items as well, namely, named pipes or FIFO's, character devices, and block devices.
 
I can't use cp since it is transferred over network. And I do know that sockets are useless to be copied, but this is rather academic, as I mentioned before. This socket file is copied by rsync -e ssh from remote server (EXT3) to the local one (UFS). And when I tried to rsync it from local server (UFS) to another local (UFS) it worked, the same local target but ZFS — rsync fails with the mentioned error. Just a weird thing I did not experience before.
 
File name and/or path is OK, both rsync and ZFS can handle it. Check the rsync(1) man page, especially:

Code:
  --specials
  This option causes rsync to transfer special files such as named
  sockets and fifos.
  -D  The -D option is equivalent to --devices --specials.

As a test:

Code:
host1:(/root)# mkdir -p /usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack/
host1:(/root)# touch /usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack/some_regular_file_to_test_the_filename_length
host1:(/root)# nc -lU /usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack/forum
host1:(/root)# ll /usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack
total 2
drwxr-xr-x  2 root  wheel  4 Oct 22 19:27 .
drwxr-xr-x  3 root  wheel  3 Oct 22 19:18 ..
srwxr-xr-x  1 root  wheel  0 Oct 22 19:27 forum
-rw-r--r--  1 root  wheel  0 Oct 22 19:19 some_regular_file_to_test_the_filename_length
host1:(/root)#
and now let's rsync it to other host:
Code:
host2:(/tmp/t)# rsync -avxD  martin@host1:/usr/zfs/backup/site.com/backup/incremental/system/dirs/_var_cpanel/userhomes/cpanelconnecttrack .
receiving incremental file list
cpanelconnecttrack/
cpanelconnecttrack/forum
cpanelconnecttrack/some_regular_file_to_test_the_filename_length

sent 50 bytes  received 187 bytes  52.67 bytes/sec
total size is 0  speedup is 0.00
host2:(/tmp/t)# cd cpanelconnecttrack
host2:(/tmp/t/cpanelconnecttrack)# ll
total 26
drwxr-xr-x  2 root  wheel  4 Oct 22 19:27 .
drwxr-xr-x  3 root  wheel  3 Oct 22 19:29 ..
srwxr-xr-x  1 root  wheel  0 Oct 22 19:27 forum
-rw-r--r--  1 root  wheel  0 Oct 22 19:19 some_regular_file_to_test_the_filename_length
host2:(/tmp/t/cpanelconnecttrack)#

It's probably valid question if you really need to copy a socket... but if you do there is a way.
 
Back
Top