RFC: Mount namespace option
Marian Marinov
mm at yuhu.biz
Fri Apr 11 18:08:31 MDT 2014
Hi, I have a new version of the namespace patches which actually works :)
All comments(good and mostly bad :) ) is greatly appreciated.
Best regards,
Marian
On 04/03/2014 04:48 PM, Marian Marinov wrote:
> Hello guys,
> I'm working a lot with Linux Containers(LXC) and find it extremely nice to have the ability to rsync files from the
host machine to the container without the need of SSH.
>
> What I did was a simple patch, which added the new option --mount-ns-pid=PID and also added a call to setns() in the
> do_fork() function.
>
> The idea is, that rsync will use the PID to create a path (/proc/PID/ns/mnt), open that path and give the file
descriptor to setns(), which in turn will switch to the new mount namespace and so, the file operations will be done in
> the new mount namespace instead of the host's own mount namespace.
>
> Are you interested in such functionality for rsync?
>
> If you are interested, can we discuss the questions bellow?
>
> - Can someone tell me what is the accepted way of accepting patches?
> I currently have the patches done for the 3.0.9 branch and for 3.1.0 branch.
>
> - setns() is found only on newer libc versions.
> I have copied the implementation from the LXC project, but with a small change, if setns is not supported on the >
machine at all it returns error. I have placed the implementation in rsync.h, but what would be the proper place for it?
>
> - should I add configure option for this new functionality?
>
> Thank you, for your comments.
>
> Best regards,
> Marian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-options.c-Add-the-mount-ns-pid-option.patch
Type: text/x-patch
Size: 1897 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140412/d1a1fde1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-rsync.h-Added-setns-support-for-machines-with-older-.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140412/d1a1fde1/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-main.c-Added-handling-of-the-mount_ns_pid-option.patch
Type: text/x-patch
Size: 1143 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140412/d1a1fde1/attachment-0002.bin>
More information about the rsync
mailing list