[opensuse-virtual] kernel-xen-conditional code in /etc/init.d startup scripts?
hi, what's the correct/recommended way to wrap conditional code in opensuse init.d scripts to exec on a -xen boot? e.g., i need to add some module exec stmts to /etc/init.d/boot.local that are specific to kernel-xen, that cause errors/warnings in boot logs -- an an occasional hang -- if they are exec'd at boot to a NON-xen (e.g., kernel-default) kernel. so, i want to check for status = {booted to kernel-xen}, and exec only if matched. should one check for current kernel via uname? something in /sys/... of /proc/... ? i understand there are many possible checks; the question is - which, if any, is the 'right' one in this case? thanks. -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-virtual+help@opensuse.org
On Tue, 08 Feb 2011, 23:43:15 +0100, dev001x wrote:
hi,
what's the correct/recommended way to wrap conditional code in opensuse init.d scripts to exec on a -xen boot?
e.g., i need to add some module exec stmts to /etc/init.d/boot.local that are specific to kernel-xen, that cause errors/warnings in boot logs -- an an occasional hang -- if they are exec'd at boot to a NON-xen (e.g., kernel-default) kernel. so, i want to check for status = {booted to kernel-xen}, and exec only if matched.
should one check for current kernel via uname? something in /sys/... of /proc/... ?
This is what I have in my /etc/init.d/boot.local to disable VMware in case Linux is booting on a Xen dom0: if [ -s /sys/hypervisor/type ]; then if [ "$(cat /sys/hypervisor/type)" = "xen" ]; then : echo Add stuff for Xen kernels here [ -s /etc/init.d/vmware ] && \ insserv -r /etc/init.d/vmware fi else : echo Add non Xen stuff here [ -s /etc/init.d/vmware ] && \ mount /proc/bus/usb fi
i understand there are many possible checks; the question is - which, if any, is the 'right' one in this case?
thanks.
HTH, cheers. l8er manfred -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-virtual+help@opensuse.org
On 08.02.11 at 23:43, "dev001x" <pgngw+dev001+opensuseML+opensuse-virtual@f-m.fm> wrote: e.g., i need to add some module exec stmts to /etc/init.d/boot.local that are specific to kernel-xen, that cause errors/warnings in boot logs -- an an occasional hang -- if they are exec'd at boot to a NON-xen (e.g., kernel-default) kernel. so, i want to check for status = {booted to kernel-xen}, and exec only if matched.
A hang? Can you point out what is hanging where? Jan -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-virtual+help@opensuse.org
hi, On Wed, 09 Feb 2011 09:04 +0000, "Jan Beulich" <JBeulich@novell.com> wrote:
On 08.02.11 at 23:43, "dev001x" <pgngw+dev001+opensuseML+opensuse-virtual@f-m.fm> wrote: e.g., i need to add some module exec stmts to /etc/init.d/boot.local that are specific to kernel-xen, that cause errors/warnings in boot logs -- an an occasional hang -- if they are exec'd at boot to a NON-xen (e.g., kernel-default) kernel. so, i want to check for status = {booted to kernel-xen}, and exec only if matched.
A hang? Can you point out what is hanging where?
for now, no. as i mentioned, it's occassional -- i.e., not reproducible, mostly cured by a reboot, and, atm, lower in priority that some of my other issues. tbh, i suspect it may well heal once "everything else" gets straightened out. if not, and i have valid info, i'll post it ... thx! -- To unsubscribe, e-mail: opensuse-virtual+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-virtual+help@opensuse.org
participants (3)
-
dev001x
-
Jan Beulich
-
Manfred Hollstein