Fri 19 Jun 2009 08:02:12 PM UTC, original submission:
Currently, rdiff-backup (v. 1.2.8) will attempt to back up socket files by using socket() and bind() to recreate the socket file on the destination system. I suggest using os.mknod() instead. The main advantage for mknod() is that it can create socket type files using paths of arbitrary length, whereas bind() is limited to a maximum of 107 characters. A disadvantage is that os.mknod() is only available for python >= 2.3.
Using mknod() instead of bind() should help to eliminate the error:
SpecialFileError somewhere/foo/bar/socket Socket error: AF_UNIX path too long
I've attached a file to this bug report that contains a patch to rpath.py which seems to work for me. It's written so that if mknod() fails, the program reverts to its current behavior for creating sockets using bind().
By the way, I don't see where anyone has ever mentioned it, but one of the reasons the "AF_UNIX path too long" error occurs is because, sooner or later, the socket changes (e.g., when a daemon is restarted) and another backup is run, creating an increment/snapshot file that looks something like this:
At 114 characters, this path will generate the "AF_UNIX path too long" error when passed to bind(), even though the lengths of the paths for the original socket (/somewhere/foo/bar/socket) and the backup destination (/somewhere-else/my-backup) are not particularly long.
Another approach for eliminating these errors would be to do what the tar command does -- ALWAYS ignore sockets when backing up (don't even permit them to be optionally backed up). After all, there really isn't much point in backing up sockets.
|