Re: v4 clientid uniquifiers in containers/namespaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2022-02-05 at 10:03 -0500, Benjamin Coddington wrote:
> Hi all,
> 
> Is anyone using a udev(-like) implementation with
> NETLINK_LISTEN_ALL_NSID?
> It looks like that is at least necessary to allow the init namespaced
> udev
> to receive notifications on /sys/fs/nfs/net/nfs_client/identifier,
> which
> would be a pre-req to automatically uniquify in containers.
> 
> I'md interested since it will inform whether I need to send patches
> to
> systemd's udev, and potentially open the can of worms over there. 
> Yet its
> not yet clear to me how an init namespaced udev process can write to
> a netns
> sysfs path.
> 
> Another option might be to create yet another daemon/tool that would
> listen
> specifically for these notifications.  Ugh.
> 
> Ben
> 

I don't understand. Why do you need a new daemon/tool?

I have the following entry in /etc/udev/rules.d:

[trondmy@leira ~]$ cat /etc/udev/rules.d/50-nfs4.rules 
ACTION=="add" KERNEL=="nfs_client" ATTR{identifier}=="(null)" PROGRAM="/usr/sbin/nfs4_uuid" ATTR{identifier}="%c"


...and a very simple script /usr/sbin/nfs4_uuid that reads as follows:

#!/bin/bash
#
if [ ! -f /etc/nfs4_uuid ]
then
        uuid="$(uuidgen -r)"
        echo -n ${uuid} > /etc/nfs4_uuid
else
        uuid="$(cat /etc/nfs4_uuid)"
fi
echo ${uuid}


-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux