Bug 193164

Summary: Enhancements for stateless/readonly root
Product: [Fedora] Fedora Reporter: Jeff Law <law>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.35-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-20 15:13:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to implement new capabilities
none
modified patch none

Description Jeff Law 2006-05-25 20:07:09 UTC
Description of problem:
This patch provides a couple enhancements for stateless/readonly root systems.

1. Allows a stateless client to use local disk space for scratchpad areas.
   Local scratchpad is discovered by entries in /etc/fstab or by local
   partitions with the right label.  If no local scratchpad area is found,
   then it falls back to tmpfs.

2. Allows a stateless client to have a place to hold persistent data (SSH keys
   or puppet certificates).  We search for a suitable entry in /etc/fstab,
   then a local partition with the right label, then finally for an NFS
   partition.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jeff Law 2006-05-25 20:07:09 UTC
Created attachment 130001 [details]
Patch to implement new capabilities

Comment 2 Bill Nottingham 2006-05-25 21:41:11 UTC
Created attachment 130006 [details]
modified patch

Here, for comments, is a modified version of the above.

Changes made:
- we can't use find or head, they're on /usr (I need to fix the usage of find
  that's earlier in the script too)
  - we can get away with rm -rf of the whole state dir because it won't let you

    remove a mount point
- I'm not convinced we need to run dhclient in rc.sysinit. I think the better
  solution is to fix the net booting code in mkinitrd to set the hostname there

  (since we're running dhcp there). If the hostname is still localhost, I look
  up the hostname without running dhcp. Apologies for that ugly 'ip addr...'   
line.
- changed /.snapshot to $STATE_MOUNT

Opinions?

Comment 3 Jeff Law 2006-05-25 23:07:15 UTC
The use of head was just being extra conservative.  After all, some moron could
create several partitions with the same label.  I think the awk scriptlet you
used ought to work just fine for dealing with that corner case.

No problem with the find -> rm change; I'm not a huge fan of redirecting errors
to /dev/null, but if we're using rm that's definitely necessary since we'll get
a nice error when it tries (and fails) to remove the mountpoint.

For the hostname, ideally we'd tweak the pump code to go ahead and set the
hostname at the same time it sets up the NIC.  It's unlikely, but possible that
there's code out there which assumes current behavior from pump (setup
interface, but ignore the DHCP provided hostname).

As for the "ip addr" stuff -- I've seen worse....

Yea, fixing /.snapshot to reference $STATE_MOUNT was definitely a goof on my
part.  Thanks for catching and fixing it.

Your changes seem fine to me.  If they cause any problems I should know tomorrow
before I disappear for the long weekend :-)

jeff

Comment 4 Bill Nottingham 2006-07-20 15:13:51 UTC
This was added a while back.