Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 515771 - Various initscript changes for netboot
Summary: Various initscript changes for netboot
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: THINCLIENT
TreeView+ depends on / blocked
 
Reported: 2009-08-05 17:09 UTC by Warren Togami
Modified: 2014-03-17 03:19 UTC (History)
5 users (show)

Fixed In Version: 8.95.1-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 17:30:05 UTC


Attachments (Terms of Use)
Patch to allow merging of files within a state mounted directory. (deleted)
2009-08-05 17:12 UTC, Warren Togami
no flags Details | Diff
ifup patch for dracut's new dhclient leases location (deleted)
2009-08-05 18:28 UTC, Warren Togami
no flags Details | Diff
Implementing dirs --files option, copy ifcfg files if they exist (deleted)
2009-08-07 20:46 UTC, Warren Togami
no flags Details | Diff
alternative pach (deleted)
2009-08-24 17:03 UTC, Bill Nottingham
no flags Details | Diff
Support rwtab and state passed from dracut initrd. (deleted)
2009-08-31 23:46 UTC, Warren Togami
no flags Details | Diff

Description Warren Togami 2009-08-05 17:09:55 UTC
This bug will contain various changes to initscripts for netboot.

Comment 1 Warren Togami 2009-08-05 17:12:34 UTC
Created attachment 356386 [details]
Patch to allow merging of files within a state mounted directory.

This is slightly modified from your earlier patch.  The * must be outside of "" quotes to allow it to expand.

Comment 2 Warren Togami 2009-08-05 17:21:31 UTC
* /etc/statetab.d/netboot contains:
/etc/sysconfig/network-scripts/

* /etc/sysconfig/readonly-root
READONLY=yes
STATE_OPTIONS="--bind /dev/.initramfs/"

* dracut passed:
/dev/.initramfs/etc/sysconfig/network-scripts/ifcfg-eth0
/dev/.initramfs/etc/sysconfig/network-scripts/ifcfg-br0

Not entirely pleased by this.  We shouldn't have long and ugly Red Hat specific paths in dracut code.  Prior to this, dracut would pass:
/dev/.initramfs/ifcfg/ifcfg-eth0
/dev/.initramfs/ifcfg/ifcfg-br0

Problems
========
1) I dislike dracut writing out a /etc/sysconfig/network-scripts/ hierarchy.  Would you accept a patch to rc.sysinit that sets up the $STATE_MOUNT/etc/sysconfig/network-scripts/ if it sees /dev/.initramfs/ifcfg/ files?

2) This means you can't use a real persistent state mount with dracut netboot, as you will not be able to overwrite the ifcfg-* files the second time.  To workaround this issue rc.sysinit could special case /etc/sysconfig/network-scripts/ and do the copying then --bind mount independent of state mounts.  Would you accept a patch for this?  (#1 is a subset of #2.)

Comment 3 Warren Togami 2009-08-05 18:28:05 UTC
Created attachment 356395 [details]
ifup patch for dracut's new dhclient leases location

Comment 4 Warren Togami 2009-08-05 19:24:44 UTC
Please add these entries to the standard /etc/rwtab

empty	/var/log/ConsoleKit/
empty   /var/lib/dbus/
empty	/var/cache/hald/
empty	/var/lib/pulse/
files   /.viminfo
files	/etc/alsa/asound.state

Comment 5 Warren Togami 2009-08-05 19:30:41 UTC
dirs    /etc/udev/rules.d/

Problem: We need this directory to be writable, but doing this in rwtab makes the files disappear.  Would you accept a patch that adds a fourth type of rwtab entry that copies all files before bind mounting?

Comment 6 Warren Togami 2009-08-05 19:51:20 UTC
> dirs    /etc/udev/rules.d/

> Problem: We need this directory to be writable, but doing this in rwtab makes
> the files disappear.  Would you accept a patch that adds a fourth type of rwtab
> entry that copies all files before bind mounting?  

Alternatively, there currently isn't much functional difference between "dirs" and "empty".  Why not modify dirs to copy files before the bind mount?

Comment 7 Warren Togami 2009-08-05 22:13:08 UTC
I am thinking a combination of Comment #6 and Comment #2 part 2.

* dirs (or a new rwtab type) copies files before it bind mounts.
* /etc/rwtab contains "dirs  /etc/sysconfig/network-scripts"
* rc.sysinit sees /dev/.initramfs/ifcfg/ and simply copies them into /etc/sysconfig/network-scripts

Benefit: This doesn't clash with state mounts, possible to use persistent state mounts with dracut netboot.  This is also simple.

Comment 8 Warren Togami 2009-08-07 20:46:55 UTC
Created attachment 356715 [details]
Implementing dirs --files option, copy ifcfg files if they exist

Add this line to the standard /etc/rwtab:
dirs   /etc/sysconfig/network-scripts/  --files

* With this patch, rwtab entry like the above will copy the directory contents into the read-write directory before bind mounting.

* Copy ifcfg files from initramfs netboot if they exists

Comment 9 Bill Nottingham 2009-08-10 20:52:32 UTC
(In reply to comment #2)
> Problems
> ========
> 1) I dislike dracut writing out a /etc/sysconfig/network-scripts/ hierarchy. 
> Would you accept a patch to rc.sysinit that sets up the
> $STATE_MOUNT/etc/sysconfig/network-scripts/ if it sees /dev/.initramfs/ifcfg/
> files?

No.

We have a mechanism for storing local system state in the initscripts; the initscripts should not be growing special-case code for each type of state (whether it's ifcfg files, or iscsi files, or whatever).

If there needs to be a bridge between dracut types and RH/Fedora-specific files, that's fine, but it should be part of the RH/Fedora dracut package, as that's what has the domain knowledge of what dracut is doing, in what versions.

Comment 10 Bill Nottingham 2009-08-10 21:28:18 UTC
(In reply to comment #4)
> Please add these entries to the standard /etc/rwtab
> 
> empty /var/log/ConsoleKit/

Already covered by dirs /var/log.

> empty   /var/lib/dbus/

I understand the idea here, but I don't see what will actually generate a new UUID.

> empty /var/cache/hald/
> empty /var/lib/pulse/

OK.

> files   /.viminfo

Not without some other justifcation, because - wtf?

> files /etc/alsa/asound.state  

We don't use this any more, that I can see.

Comment 11 Warren Togami 2009-08-11 02:47:45 UTC
> No.

> We have a mechanism for storing local system state in the initscripts; the
> initscripts should not be growing special-case code for each type of state
> (whether it's ifcfg files, or iscsi files, or whatever).

> If there needs to be a bridge between dracut types and RH/Fedora-specific
> files, that's fine, but it should be part of the RH/Fedora dracut package, as
> that's what has the domain knowledge of what dracut is doing, in what 

This does not create a solution for the problem in Comment #2 part 2.  ifcfg files passed by dracut is incompatible with persistent state mounts.  The patch in Comment #8 is a better solution for this, while being useful for other purposes.

Comment 12 Bill Nottingham 2009-08-11 15:06:23 UTC
(In reply to comment #11)
> This does not create a solution for the problem in Comment #2 part 2.  ifcfg
> files passed by dracut is incompatible with persistent state mounts.  The patch
> in Comment #8 is a better solution for this, while being useful for other
> purposes.  

How so - what do you mean by 'second' time?

Comment 13 Warren Togami 2009-08-12 15:36:55 UTC
OK, I was thinking in the wrong direction.

Here is the issue.  If we use state mounts as you suggest to have /dev/.initramfs/ as $STATE_MOUNT, it works for this situation, however there are two problems.

* This requires a RH-specific ugly hack in dracut.
* This makes it impossible to use a real persistent state mount with dracut netboot.  Netboot is exactly where persistent state mount is useful.

So in effect you are suggesting we use existing mechanism at the expense of the original purpose of that mechanism.

Comment #8 is a clean and simple solution.

Comment 14 Warren Togami 2009-08-12 19:34:39 UTC
NOTE: The patch in Comment #8 is also an elegant solution to the problem in Comment #5.

Comment 15 Warren Togami 2009-08-12 20:24:53 UTC
>> empty   /var/lib/dbus/
> I understand the idea here, but I don't see what will actually generate a new
UUID.

Starting system message bus: Could not create file /var/lib/dbus/machine-id: Read-only file system

Comment 16 Warren Togami 2009-08-17 18:56:30 UTC
>> files /etc/alsa/asound.state  
> We don't use this any more, that I can see.  

Sending all processes the KILL signal...                     [OK]
Saving mixer settings /sbin/alsactl: save_state:1530: Cannon open /etc/asound.state for writing: Read-only file system

Comment 17 Bill Nottingham 2009-08-24 16:35:36 UTC
(In reply to comment #16)
> >> files /etc/alsa/asound.state  
> > We don't use this any more, that I can see.  
> 
> Sending all processes the KILL signal...                     [OK]
> Saving mixer settings /sbin/alsactl: save_state:1530: Cannon open
> /etc/asound.state for writing: Read-only file system  

That makes more sense - you had the wrong path initially. However, I do wonder how necessary having it writable on shutdown that is, for a stateless install. I suspect that redirecting stderr is a better solution.

Comment 18 Bill Nottingham 2009-08-24 17:03:53 UTC
Created attachment 358491 [details]
alternative pach

The point about breaking 'normal' state mounts is true.

As for dirs --files, that isn't/shouldn't be necessary - just use 'files <foo>'.

Here's an alternative solution, which should be easily implementable, not too hackish, and ensures that the initramfs can do whatever it needs for future situations without requiring synchronized updates with initscripts.

The idea is that dracut (or the hooks for RH/Fedora) contain its own rwtab file, which can be extended with whatever it needs. For this initial case, it would likely be:

files /etc/sysconfig/network-scripts

Later, it could add:

files /etc/iscsi.conf

or whatever.

Then, once that is processed, there's a single copy of whatever state the initramfs wants to provide is needed into the writable temporary state dir.

Comment 19 Bill Nottingham 2009-08-24 17:04:53 UTC
The /dev/.initramfs/state is a made-up directory name; we can use whatever.

Comment 20 Warren Togami 2009-08-31 23:46:26 UTC
Created attachment 359334 [details]
Support rwtab and state passed from dracut initrd.

That almost worked.  Missing a trailing *.  Attached patch works for me with accompanying code in dracut-0.10+.

Comment 22 Fedora Update System 2009-12-05 15:22:23 UTC
initscripts-8.95.1-1 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/initscripts-8.95.1-1

Comment 23 Fedora Update System 2009-12-22 04:49:34 UTC
initscripts-8.95.1-1 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.