aaminoff
April 8th, 2011, 04:34 PM
We have a diskless setup that we have used for several years for FreeBSD and Fedora. (Here is a semi-relevant description (http://www.nber.org/sys-admin/FreeBSD-diskless.html)). I need to port this system to Ubuntu. I have ubuntu booting off the NFS server.
The hard part now is to have it run our cross-platform diskless initialization script, which is derived from FreeBSD's rc.initdiskless. (http://src.gnu-darwin.org/src/etc/rc.initdiskless.html)This script sets up in-memory file systems for /etc, /var, and others, then copies in appropriate contents. There is a lot of logic for configuring individual diskless-booted machines to do particular things, so this system also provides configuration management sort of like cfengine or similar, especially by building the contents of /etc.
Things just aren't working right. I'm concerned that upstart is reading /etc/init/*.conf in parallel with my script replacing /etc with an empty in-memory fs and then copying in the contents. In FreeBSD and Fedora it was pretty easy to ensure that our script got run before everything else: the boot process was basically sequenctial. However, upstart (or rather, init, which then fires off things based on upstart in parallel) starts before the end of the initramfs.
My questions are:
- Am I right that upstart starts while we are still running the init script from the initramfs? Looking in the initramfs it seems as though the real root fs has been mounted (nfs in our case) by that point, so we are reading from nfsserver:/path/to/root/etc/init/*,conf?
- How can I get my script to run before anything else that wants to look up config in /etc? In particular, what if some script running in parallel wants to look up a uid with getent, but there is no /etc/nsswitch.conf?
- I have looked at the Upstart cookbook (http://upstart.ubuntu.com/cookbook/), but can not figure out the answer from that. Upstart is all about running stuff in parallel.
- Should I ask on the upstart-devel list instead? Is there some better place?
The hard part now is to have it run our cross-platform diskless initialization script, which is derived from FreeBSD's rc.initdiskless. (http://src.gnu-darwin.org/src/etc/rc.initdiskless.html)This script sets up in-memory file systems for /etc, /var, and others, then copies in appropriate contents. There is a lot of logic for configuring individual diskless-booted machines to do particular things, so this system also provides configuration management sort of like cfengine or similar, especially by building the contents of /etc.
Things just aren't working right. I'm concerned that upstart is reading /etc/init/*.conf in parallel with my script replacing /etc with an empty in-memory fs and then copying in the contents. In FreeBSD and Fedora it was pretty easy to ensure that our script got run before everything else: the boot process was basically sequenctial. However, upstart (or rather, init, which then fires off things based on upstart in parallel) starts before the end of the initramfs.
My questions are:
- Am I right that upstart starts while we are still running the init script from the initramfs? Looking in the initramfs it seems as though the real root fs has been mounted (nfs in our case) by that point, so we are reading from nfsserver:/path/to/root/etc/init/*,conf?
- How can I get my script to run before anything else that wants to look up config in /etc? In particular, what if some script running in parallel wants to look up a uid with getent, but there is no /etc/nsswitch.conf?
- I have looked at the Upstart cookbook (http://upstart.ubuntu.com/cookbook/), but can not figure out the answer from that. Upstart is all about running stuff in parallel.
- Should I ask on the upstart-devel list instead? Is there some better place?