Multiple paths in a module?

2022-03-05 Thread Glen Huang via rsync
Hi,

I'm trying to set up a module for rsyncd where it offers multiple
paths like /var/www, /etc/app, etc to be accessed by clients.

However, from rsyncd.conf(5) it seems a module can point to only one
path. So it seems I should use something like a bind mount, and mount
paths to /mnt/{var/www,etc/app}, then point the module to /mnt.
However, the paths that should be available in the module are
dynamically configured. So I can't make the root user mount them
beforehand. My only option seems to be mounting them in the "early
exec" hook. However, this seems to mean the module has to have the
root's uid, which I'd really like to avoid.

So I came to a dead end. I wonder if a module could somehow directly
offer multiple paths?

Would be grateful if someone could shed some light.

Thanks.

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Multiple paths in a module?

2022-03-05 Thread Glen Huang via rsync
On Sat, Mar 5, 2022 at 10:34 PM Roland  wrote:
>
> why no writing your own systemd service which does the
> mounting and setting proper dependency, so it starts before rsyncd starts ?

Thanks for the quick reply.

The clients will use rsyncd via ssh, so there is no systemd service in
play, and as I mentioned previously, the mounting paths are
dynamically configured in another service, so I need to remount
whenever the paths change if I mount them beforehand. With the "early
exec" hook, I can avoid such remounting, but it's only doable with root...

Regards,
Glen

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Multiple paths in a module?

2022-03-05 Thread Perry Hutchison via rsync
Glen Huang via rsync  wrote:

> ... the mounting paths are dynamically configured in another
> service, so I need to remount whenever the paths change
> if I mount them beforehand.

Could the remount be done in that other service?

> With the "early exec" hook, I can avoid such remounting,
> but it's only doable with root...

General approach when only part of a job requires root:

1.  Set the remount program permissions to
-r-sr-xr--  root  foo
(i.e. setuid root, executable only by group foo).
The program must be an executable binary, not a script.

2.  Ensure that the service which will run the remounter
-- and only that service -- runs as group "foo".

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Multiple paths in a module?

2022-03-05 Thread Harry Mangalam via rsync
I may be missing your intent, but why not set up different rsyncd modules
for the different paths?
Or are you saying that the paths change dynamically all the time?  In which
case set a cron or triggered script to change the symlinks to the paths..?
H

On Sat, Mar 5, 2022 at 5:08 AM Glen Huang via rsync 
wrote:

> Hi,
>
> I'm trying to set up a module for rsyncd where it offers multiple
> paths like /var/www, /etc/app, etc to be accessed by clients.
>
> However, from rsyncd.conf(5) it seems a module can point to only one
> path. So it seems I should use something like a bind mount, and mount
> paths to /mnt/{var/www,etc/app}, then point the module to /mnt.
> However, the paths that should be available in the module are
> dynamically configured. So I can't make the root user mount them
> beforehand. My only option seems to be mounting them in the "early
> exec" hook. However, this seems to mean the module has to have the
> root's uid, which I'd really like to avoid.
>
> So I came to a dead end. I wonder if a module could somehow directly
> offer multiple paths?
>
> Would be grateful if someone could shed some light.
>
> Thanks.
>
> --
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options:
> https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
>


-- 

Harry Mangalam
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html