Amazon (or perhaps Amazon's configuration of Xen) forces a machine to come up at run level 4, regardless of what's in /etc/inittab. I've looked through /etc/rc.sysinit and /etc/rc.d/rc, to determine which (if any script) looks at /proc/cmdline and forces a particular run level, but to no avail. It seems that /sbin/init does the forcing. Can anyone confirm that /sbin/init reads /proc/cmdline to overwrite /etc/inittab? I can't seem to find any reference in man pages or searching the web. Thanks, Kurt
On Tue, Jan 26, 2010 at 2:48 PM, Kurt Newman <knewman at globaldataguard.com> wrote:> Amazon (or perhaps Amazon's configuration of Xen) forces a machine to > come up at run level 4, regardless of what's in /etc/inittab. > > I've looked through /etc/rc.sysinit and /etc/rc.d/rc, to determine which > (if any script) looks at /proc/cmdline and forces a particular run > level, but to no avail. >> It seems that /sbin/init does the forcing. ?Can anyone confirm that > /sbin/init reads /proc/cmdline to overwrite /etc/inittab? ?I can't seem > to find any reference in man pages or searching the web.You *can* override the initdefault in inittab via the kernel option, but if you're not seeing it in /proc/cmdline it's likely some other rc script. I saw some references to this being controlled via xen: http://somic.org/2008/06/20/ec2-instances-always-boot-to-runlevel-4/ Alas, the links are dead... Another site shows: http://www.novell.com/support/search.do?cmd=displayKC&docType=kc&externalId=7001985&sliceId=1&docTypeID=DT_TID_1_1 ---quote Xen para-virtual SLE (all versions), first method This method uses the legacy installation file. Any hardware changes made to a managed domain via "YaST", "virt-manager" or "xm commands" will not be present. Replace "DOMU" with the name of your DomU. 1. Go to /etc/xen/vm 2. Locate the installation file, usually the name of the Xen DomU 3. Use the "xm create" command. (The -c will connect to the console, and xencons=xvc0 will use the Xen frame buffer for SLES 10 SP1 and higher, and SLES 9 SP4. Use xencons=tty for SLES 10). xm create -c DOMU extra=" init 1 xencons=xvc0" 4. Shutdown the DomU after making changes 5. Start the DomU normally" ---quote So it may be being passed through xen which might not show up in proc/cmdline (can't test right now).
> Kwan Lowe wrote: > > > Kurt Newman wrote: > > > Amazon (or perhaps Amazon's configuration of Xen) forces a machine to > > > come up at run level 4, regardless of what's in /etc/inittab. > > > > > > I've looked through /etc/rc.sysinit and /etc/rc.d/rc, to determine which > > > (if any script) looks at /proc/cmdline and forces a particular run > > > level, but to no avail. > > > > > > It seems that /sbin/init does the forcing. Can anyone confirm that > > > /sbin/init reads /proc/cmdline to overwrite /etc/inittab? I can't seem > > > to find any reference in man pages or searching the web. > > > > > You *can* override the initdefault in inittab via the kernel option, > but if you're not seeing it in /proc/cmdline it's likely some other rc > script. I saw some references to this being controlled via xen: > > ... > > So it may be being passed through xen which might not show up in > proc/cmdline (can't test right now).Perhaps I mis-stated what I was asking. I'm well aware that Amazon (aka Xen) is passing run level 4 to the kernel because the number '4' is in /proc/cmdline. I can't change that since I cannot configure Xen or even ask Amazon to. What I'm trying to figure out is at what point in the booting process is something looking at /proc/cmdline INSTEAD of /etc/inittab for the default run level. Is it /sbin/init? I can't seem to find any reference of that in any man pages. Essentially, I'm trying to short-circuit this boot process to execute a run level of my choosing, and not be forced to use 4. I've already looked at modifying /etc/rc.d/rc (since it's the one that uses /sbin/runlevel to execute various /etc/rcX.d scripts. I was hoping to have a more elegant way so that I don't have to maintain CentOS-specific bootstrap code.