Hide Forgot
Description of problem: Customer has a goal of using diskless systems, booting via NFS. In order to be able to share one root filesystem with all the servers, the idea is to user read only root filesystem, configured at /etc/sysconfig/readonly-root. Although the configuration of stateless files and directories is working (through /etc/rwtab[.d]), it's not possible to configure persistent files. As far as I noticed, rc.sysconfig partially implements this: <..> elif [ ! -z "$CLIENTSTATE" ]; then # No local storage was found. Make a final attempt to find # state on an NFS server. mount -t nfs $CLIENTSTATE/$HOSTNAME $STATE_MOUNT -o rw,nolock fi <..> The issue seems to be that $CLIENTSTATE is not set anywhere Version-Release number of selected component (if applicable): initscripts-9.03.23-1.el6.x86_64 (RHEL 6.1) How reproducible: Always. Steps to Reproduce: 1. Create a root filesystem, as described in http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/diskless-nfs-config.html 2. Modify PXE configuration to mount rootfs in read-only mode (/var/lib/tftpboot/pxelinux.cfg/default) 3. Edit /etc/sysconfig/readonly-root and change READONLY and TEMPORARY_STATE to "yes" 4. Create NFS export for persistent files: # mkdir /exports/nfs/state # echo -e “/exports/nfs/state\t192.168.122.0/255.255.252.0(rw,no_root_squash)” >> /etc/exports # exportfs -ra 5. Add CLIENTSTATE=nfsserver.domain:/exports/nfs/state to kernel cmdline at /var/lib/tftpboot/pxelinux.cfg/default 6. Boot the diskless server Actual results: Persistent data export isn't mounted. Expected results: Persistent data export should be mounted according to CLIENTSTATE variable.
CLIENTSTATE is supposed to be set in the image itself.
According to http://fedoraproject.org/wiki/StatelessLinux/ClientConfiguration, which seems to be outdated, CLIENTSTATE should be set on kernel command line. Anyway, the only files rc.sysinit seems to source are: . /etc/sysconfig/network . /etc/init.d/functions . /etc/selinux/config . /etc/sysconfig/autofsck . /etc/sysconfig/readonly-root Which file would be the correct one to set CLIENTSTATE? Probably /etc/sysconfig/readonly-root, but I'd like to be sure of it. If this is true, wouldn't be nice to add something like the following to this config file? # NFS server to use for persistent data? CLIENTSTATE= If empty, it wouldn't be used.
Good idea. Done upstream at 74746399b84771b0990206c402cc8cc87ec35e2d.