ifstated(8) missing if state changes?
Hi list, it seems that ifstated(8) sometimes does not see all events and thus fails to change state. My setup consists of 2 boxes with 5 carp interfaces. CARP works fine, on box frw1 all are MASTER and on box frw2 all are in BACKUP state. When i bring down all carp interfaces on frw1, all get MASTER on frw2. However, ifstated(8) on frw2 does not change state. [EMAIL PROTECTED] [~] # cat /etc/ifstated.conf init-state auto carp_up = carp0.link.up carp1.link.up carp2.link.up carp3.link.up carp5.link.up carp_down = carp0.link.down || carp1.link.down || carp2.link.down || carp3.link.down || carp5.link.down state auto{ if ($carp_up) set-state master if ($carp_down) set-state slave } state master{ init{ run logger CARP up! # run /root/scripts/carp-up.sh } if ($carp_down) set-state slave } state slave{ init{ run logger CARP down! # run /root/scripts/carp-down.sh } if ($carp_up) set-state master } I did a ktrace on the ifstated(8) process on frw2 and the dump gives: [EMAIL PROTECTED] [~] # kdump -l | grep carp \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\f\0\M-w\^E\^F\0carp0\0\0^\0\^A \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\r\0\M-w\^E\^F\0carp1\0\0^\0\^A\v\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^N\0\M-w\^E\^F\0carp2\0\0^\0\ \0\0\0\0\0\0\0\^T\^R\^N\0\M-w\^E\^F\0carp2\0\0^\0\^A\f\0\^P\^B\0\0\M-,\^U\^A\ \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\f\0\M-w\^E\^F\0carp0\0\0^\0\^A \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\r\0\M-w\^E\^F\0carp1\0\0^\0\^A\v\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^N\0\M-w\^E\^F\0carp2\0\0^\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^O\0\M-w\^E\^F\0carp3\0\0^\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^P\0\M-w\^E\^F\0carp5\0\0^\0\ The first 3 lines show the transition from BACKUP to MASTER. carp3 and carp 5 are missing! The other lines show the transition from MASTER to BACKUP. I have verified in both cases that *all* carp devices changed state with ifconfig(8). Are there known issues with ifstated(8) or kevent(2) about lost events? As a workaround i will change my $carp_up definition to test if *any* of the interfaces is up, but that isnot a good solution. Any clues? Heinrich Rebehn University of Bremen Physics / Electrical and Electronics Engineering - Department of Telecommunications - Phone : +49/421/218-4664 Fax :-3341 OpenBSD 4.2-stable (GENERIC) #2: Wed Oct 17 10:08:11 CEST 2007 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC cpu0: AMD Athlon(tm) 64 Processor 3000+ (AuthenticAMD 686-class, 512KB L2 cache) 1.81 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3 cpu0: AMD erratum 89 present, BIOS upgrade may be required real mem = 536113152 (511MB) avail mem = 510750720 (487MB) mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 11/03/05, BIOS32 rev. 0 @ 0xf0010, SMBIOS rev. 2.3 @ 0xf0530 (67 entries) bios0: vendor American Megatrends Inc. version 0219 date 11/03/2005 bios0: ASUSTeK Computer Inc. A8V apm0 at bios0: Power Management spec V1.2 apm0: AC on, battery charge unknown apm0: flags 30102 dobusy 0 doidle 1 pcibios0 at bios0: rev 2.1 @ 0xf/0x1 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf5980/192 (10 entries) pcibios0: PCI Interrupt Router at 000:17:0 (VIA VT8237 ISA rev 0x00) pcibios0: PCI bus #1 is the last bus bios0: ROM list: 0xc/0xb000 0xcb000/0x4000! 0xcf000/0x800 0xcf800/0x800 cpu0 at mainbus0 pci0 at mainbus0 bus 0: configuration mode 1 (no bios) pchb0 at pci0 dev 0 function 0 VIA K8HTB Host rev 0x00 pchb1 at pci0 dev 0 function 1 VIA K8HTB Host rev 0x00 pchb2 at pci0 dev 0 function 2 VIA K8HTB Host rev 0x00 pchb3 at pci0 dev 0 function 3 VIA K8HTB Host rev 0x00 pchb4 at pci0 dev 0 function 4 VIA K8HTB Host rev 0x00 pchb5 at pci0 dev 0 function 7 VIA K8HTB Host rev 0x00 ppb0 at pci0 dev 1 function 0 VIA K8HTB AGP rev 0x00 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 ATI Rage 128 Pro TF rev 0x00 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) skc0 at pci0 dev 10 function 0 Marvell Yukon 88E8001/8003/8010 rev 0x13, Yukon Lite (0x9): irq 10 sk0 at skc0 port A: address 00:13:d4:de:cf:88 eephy0 at sk0 phy 0: Marvell 88E1011 Gigabit PHY, rev. 5 xl0 at pci0 dev 12 function 0 3Com 3c905C 100Base-TX rev 0x78: irq 10, address 00:0a:5e:61:7a:2d exphy0 at xl0 phy 24: 3Com internal media interface xl1 at pci0 dev 14 function 0 3Com 3c905C 100Base-TX rev 0x78: irq 3, address 00:0a:5e:61:7a:04 exphy1 at xl1 phy 24: 3Com internal media interface pciide0 at pci0 dev 15 function 0 VIA VT6420 SATA rev 0x80: DMA pciide0: using irq 10 for native-PCI interrupt wd0 at pciide0 channel 1 drive 0: Maxtor 6V080E0 wd0: 16-sector PIO, LBA48, 76293MB, 15625 sectors wd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 5
ifstated(8) missing if state changes?
Hi list, it seems that ifstated(8) sometimes does not see all events and thus fails to change state. My setup consists of 2 boxes with 5 carp interfaces. CARP works fine, on box frw1 all are MASTER and on box frw2 all are in BACKUP state. When i bring down all carp interfaces on frw1, all get MASTER on frw2. However, ifstated(8) on frw2 does not change state. [EMAIL PROTECTED] [~] # cat /etc/ifstated.conf init-state auto carp_up = carp0.link.up carp1.link.up carp2.link.up carp3.link.up carp5.link.up carp_down = carp0.link.down || carp1.link.down || carp2.link.down || carp3.link.down || carp5.link.down state auto{ if ($carp_up) set-state master if ($carp_down) set-state slave } state master{ init{ run logger CARP up! # run /root/scripts/carp-up.sh } if ($carp_down) set-state slave } state slave{ init{ run logger CARP down! # run /root/scripts/carp-down.sh } if ($carp_up) set-state master } I did a ktrace on the ifstated(8) process on frw2 and the dump gives: [EMAIL PROTECTED] [~] # kdump -l | grep carp \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\f\0\M-w\^E\^F\0carp0\0\0^\0\^A \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\r\0\M-w\^E\^F\0carp1\0\0^\0\^A\v\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^N\0\M-w\^E\^F\0carp2\0\0^\0\ \0\0\0\0\0\0\0\^T\^R\^N\0\M-w\^E\^F\0carp2\0\0^\0\^A\f\0\^P\^B\0\0\M-,\^U\^A\ \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\f\0\M-w\^E\^F\0carp0\0\0^\0\^A \M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\r\0\M-w\^E\^F\0carp1\0\0^\0\^A\v\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^N\0\M-w\^E\^F\0carp2\0\0^\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^O\0\M-w\^E\^F\0carp3\0\0^\0\ \M^?\M^?\M^?\M^?\0\0\0\0\0\0\0\0\0\0\0\0\^T\^R\^P\0\M-w\^E\^F\0carp5\0\0^\0\ The first 3 lines show the transition from BACKUP to MASTER. carp3 and carp 5 are missing! The other lines show the transition from MASTER to BACKUP. I have verified in both cases that *all* carp devices changed state with ifconfig(8). Are there known issues with ifstated(8) or kevent(2) about lost events? As a workaround i will change my $carp_up definition to test if *any* of the interfaces is up, but that isnot a good solution. Any clues? Heinrich Rebehn University of Bremen Physics / Electrical and Electronics Engineering - Department of Telecommunications - Phone : +49/421/218-4664 Fax :-3341 OpenBSD 4.2-stable (GENERIC) #2: Wed Oct 17 10:08:11 CEST 2007 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC cpu0: AMD Athlon(tm) 64 Processor 3000+ (AuthenticAMD 686-class, 512KB L2 cache) 1.81 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3 cpu0: AMD erratum 89 present, BIOS upgrade may be required real mem = 536113152 (511MB) avail mem = 510750720 (487MB) mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 11/03/05, BIOS32 rev. 0 @ 0xf0010, SMBIOS rev. 2.3 @ 0xf0530 (67 entries) bios0: vendor American Megatrends Inc. version 0219 date 11/03/2005 bios0: ASUSTeK Computer Inc. A8V apm0 at bios0: Power Management spec V1.2 apm0: AC on, battery charge unknown apm0: flags 30102 dobusy 0 doidle 1 pcibios0 at bios0: rev 2.1 @ 0xf/0x1 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf5980/192 (10 entries) pcibios0: PCI Interrupt Router at 000:17:0 (VIA VT8237 ISA rev 0x00) pcibios0: PCI bus #1 is the last bus bios0: ROM list: 0xc/0xb000 0xcb000/0x4000! 0xcf000/0x800 0xcf800/0x800 cpu0 at mainbus0 pci0 at mainbus0 bus 0: configuration mode 1 (no bios) pchb0 at pci0 dev 0 function 0 VIA K8HTB Host rev 0x00 pchb1 at pci0 dev 0 function 1 VIA K8HTB Host rev 0x00 pchb2 at pci0 dev 0 function 2 VIA K8HTB Host rev 0x00 pchb3 at pci0 dev 0 function 3 VIA K8HTB Host rev 0x00 pchb4 at pci0 dev 0 function 4 VIA K8HTB Host rev 0x00 pchb5 at pci0 dev 0 function 7 VIA K8HTB Host rev 0x00 ppb0 at pci0 dev 1 function 0 VIA K8HTB AGP rev 0x00 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 ATI Rage 128 Pro TF rev 0x00 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) skc0 at pci0 dev 10 function 0 Marvell Yukon 88E8001/8003/8010 rev 0x13, Yukon Lite (0x9): irq 10 sk0 at skc0 port A: address 00:13:d4:de:cf:88 eephy0 at sk0 phy 0: Marvell 88E1011 Gigabit PHY, rev. 5 xl0 at pci0 dev 12 function 0 3Com 3c905C 100Base-TX rev 0x78: irq 10, address 00:0a:5e:61:7a:2d exphy0 at xl0 phy 24: 3Com internal media interface xl1 at pci0 dev 14 function 0 3Com 3c905C 100Base-TX rev 0x78: irq 3, address 00:0a:5e:61:7a:04 exphy1 at xl1 phy 24: 3Com internal media interface pciide0 at pci0 dev 15 function 0 VIA VT6420 SATA rev 0x80: DMA pciide0: using irq 10 for native-PCI interrupt wd0 at pciide0 channel 1 drive 0: Maxtor 6V080E0 wd0: 16-sector PIO, LBA48, 76293MB, 15625 sectors wd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 5