≡ Menu

timer

Alarm clock: How To Set Timeout For A Shell Command

Q. How can I run a command called foo, and have it timeout / abort after 10 seconds under GNU/Linux running bash shell or script? How do I run command under an alarm clock?
[click to continue…]

Q. I've upgrade my CentOS / RHEL (Red Hat Enterprise Linux) 4.7 on HP ProLiant DL580 G5 and it is showing unknown NMI errors in the logs:

Uhhuh. NMI received for unknown reason 30.
Dazed and confused, but trying to continue
Do you have a strange power saving mode enabled?

Uhhuh. NMI received for unknown reason 20.
Dazed and confused, but trying to continue
Do you have a strange power saving mode enabled?

How do I fix this error?
A. This is caused when the system is hanging under load. Add any one of the following to you /boot/grub.conf file:

  1. Disable the NMI watchdog by adding "nmi_watchdog=0"
  2. Disable the high precision event timer (HPET) by adding "nohpet"

Open grub.conf, type:
vi grub.conf
Make modification to kernel line as follows:

title Red Hat Enterprise Linux AS (2.6.9-78.0.8.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-78.0.8.EL ro nohpet root=/dev/VolGroup00/LogVol00 nohpet
        initrd /initrd-2.6.9-78.0.8.EL.img

Save and close the file. Reboot the server:
# reboot

Linux list all IROs currently in use

Q. How do I list all IRQs currently used under CentOS Linux?

A.. There is a file called /proc/interrupts. The proc filesystem is a pseudo filesystem which is used as an interface to kernel data structures. It is commonly mounted at /proc.

This is used to record the number of interrupts per each IRQ on (at least) the i386 architecture. Very easy to read formatting, done in ASCII.

Display /proc/interrupts

Use cat or less command:
$ cat /proc/interrupts
Output:

           CPU0       CPU1       CPU2       CPU3
  0:        187          0          0          0   IO-APIC-edge      timer
  1:      39922          0          0          0   IO-APIC-edge      i8042
  7:          0          0          0          0   IO-APIC-edge      parport0
  8:          4          0          0          0   IO-APIC-edge      rtc
  9:          1          0          0          0   IO-APIC-fasteoi   acpi
 12:     846774          0          0          0   IO-APIC-edge      i8042
 14:     105048          0          0          0   IO-APIC-edge      libata
 15:          0          0          0          0   IO-APIC-edge      libata
 16:    1069722          0          0          0   IO-APIC-fasteoi   libata, uhci_hcd:usb4, nvidia
 17:     105382          0          0          0   IO-APIC-fasteoi   eth0
 18:      83040          0          0          0   IO-APIC-fasteoi   uhci_hcd:usb2, libata
 19:          0          0          0          0   IO-APIC-fasteoi   uhci_hcd:usb1, ehci_hcd:usb5
 20:     474168          0          0          0   IO-APIC-fasteoi   uhci_hcd:usb3, ohci1394, ra0
 21:      10117          0          0          0   IO-APIC-fasteoi   bttv0
 22:     594327          0          0          0   IO-APIC-fasteoi   HDA Intel
NMI:          0          0          0          0
LOC:    1754492    1545836    2085855    1878596
ERR:          0
MIS:          0