I'm playing around with hoststated. I have two systems behind the firewall running hoststated. I setup Apache on the boxes to act as proxies, everything works nicely, until I disable the service and then enable the same service, hoststated dies.

(full dmesg and other info below)

Output from running hoststated -d

# hoststated -d
startup
init_filter: filter init done
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
init_tables: created 1 tables
host 10.0.0.3, check http code (30ms), state unknown -> up, availability 100.00%
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
host 10.0.0.2, check http code (112ms), state unknown -> up, availability 100.00%
pfe_dispatch_imsg: state 1 for host 1 10.0.0.3
pfe_dispatch_imsg: state 1 for host 0 10.0.0.2
sync_table: table www: 2 added, 0 deleted, 0 changed
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
pfe_sync: enabling ruleset
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
sync_ruleset: rule added
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
disable_service: disabled service 0
flush_table: flushed table www
pfe_sync: disabling ruleset
sync_ruleset: rules removed
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
enable_service: enabled service 0
enable_table: enabled table 0
hce_notify_done: 10.0.0.3 (tcp_read_buf: check succeeded)
host 10.0.0.3, check http code (7ms), state unknown -> up, availability 100.00%
hce_notify_done: 10.0.0.2 (tcp_read_buf: check succeeded)
host 10.0.0.2, check http code (10ms), state unknown -> up, availability 100.00%
pfe_dispatch_imsg: state 1 for host 1 10.0.0.3
pfe_dispatch_imsg: state 1 for host 0 10.0.0.2
relay_dispatch_pfe: host 1 => 1
relay_dispatch_pfe: host 1 => 1
fatal: relay_dispatch_pfe: desynchronized
relay_dispatch_pfe: host 1 => 1
fatal: relay_dispatch_pfe: desynchronized
signal 20
relay_dispatch_pfe: host 1 => 1
fatal: relay_dispatch_pfe: desynchronized
check_child: lost child: socket relay engine exited
relay_dispatch_pfe: host 1 => 1
fatal: relay_dispatch_pfe: desynchronized
host check engine exiting
kill_tables: deleted 1 tables
fatal: relay_dispatch_pfe: desynchronized
flush_rulesets: flushed rules
pf update engine exiting
terminating
#

I made sure the connections were working then did

# hoststatectl service disable www
command succeeded
# hoststatectl service enable www
command succeeded


# cat /etc/hoststated.conf |grep -v ^#
ext_addr="192.168.1.181"
webhost1="10.0.0.2"
webhost2="10.0.0.3"

interval 5

table webhosts {
        real port http
        check http "/" code 200
        host $webhost1
        host $webhost2
}

service www {
        virtual host $ext_addr port http
        #virtual host $ext_addr port http interface trunk0

        # tag every packet that goes thru the rdr rule with HOSTSTATED
        tag HOSTSTATED

        table webhosts
        sticky-address
        #backup table fallback
}




#


# cat /etc/pf.conf |grep -v ^# ext_if="sis0"
int_if="sis1"
pfsync_if="sis1"
carp_interfaces="{ carp0, carp1 }"
carp_int="carp1"
carp_ext="carp0"
all_if="{ sis0, sis1, sis2, carp0, carp1 }"
physical_interfaces="{ sis0, sis1, sis2 }"


table <dns_servers> persist file "/etc/dns_servers"
table <webproxy_servers> persist file "/etc/webproxy_servers"
ssh_servers="10.0.0.2"
alt_ssh_servers="10.0.0.3"
set require-order yes
set debug urgent
set block-policy return
set optimization normal
set limit { frags 5000, states 10000 }
set timeout interval 30
set timeout frag 30
set skip on lo0
set skip on $pfsync_if
nat from $carp_int:network to any -> $carp_ext
rdr-anchor "hoststated/*"
rdr inet proto tcp from any to $carp_ext port 22 -> $ssh_servers
rdr inet proto tcp from any to $carp_ext port 23 -> $alt_ssh_servers port 22 rdr inet proto { tcp, udp } from any to $carp_ext port 53 -> <dns_servers> round-robin sticky-address
block in log (all) on $all_if
block in on $int_if
block in on $carp_int
block in on $carp_ext
block in log all
block in inet6
pass out on $all_if modulate state
pass on { $ext_if $int_if } proto carp modulate state
pass in log (all) inet proto icmp from $carp_int:network to $carp_int icmp-type echoreq modulate state pass in log inet proto tcp from $carp_ext:network to $ext_if port ssh flags S/SA modulate state pass in log inet proto tcp from any to $ssh_servers port { ssh } flags S/SA synproxy state pass in log inet proto tcp from any to $alt_ssh_servers port { 22 } flags S/SA synproxy state pass in inet proto { tcp, udp } from any to <dns_servers> port domain flags S/SA synproxy state pass in inet proto { tcp } from any to <webproxy_servers> port 80 modulate state pass in inet proto { tcp, udp } from $carp_int:network to any port { domain, ntp, www } modulate state


And finally dmesg from the host running hoststated (I am running GENERIC, just named it using the date I did the compile. I'm following 4.1-stable and have automated the process, using the date I can tell with a uname if the system is up to date or not.) This is Soekris 4801 box.

# dmesg
OpenBSD 4.1-stable (20070816) #0: Thu Aug 16 14:09:23 GMT 2007
    [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/20070816
cpu0: Geode(TM) Integrated Processor by National Semi ("Geode by NSC" 586-class) 267 MHz
cpu0: FPU,TSC,MSR,CX8,CMOV,MMX
cpu0: TSC disabled
real mem  = 133787648 (130652K)
avail mem = 114675712 (111988K)
using 1663 buffers containing 6811648 bytes (6652K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+ BIOS, date 20/41/06, BIOS32 rev. 0 @ 0xf7840
pcibios0 at bios0: rev 2.0 @ 0xf0000/0x10000
pcibios0: pcibios_get_intr_routing - function not supported
pcibios0: PCI IRQ Routing information unavailable.
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xc8000/0x9000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Cyrix GXm PCI" rev 0x00
sis0 at pci0 dev 6 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c1:ca:30
nsphyter0 at sis0 phy 0: DP83815 10/100 PHY, rev. 1
sis1 at pci0 dev 7 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c1:ca:31
nsphyter1 at sis1 phy 0: DP83815 10/100 PHY, rev. 1
sis2 at pci0 dev 8 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c1:ca:32
nsphyter2 at sis2 phy 0: DP83815 10/100 PHY, rev. 1
hifn0 at pci0 dev 14 function 0 "Hifn 7951" rev 0x01: LZS 3DES ARC4 MD5 SHA1 RNG PK, 128KB sram, irq 11
gscpcib0 at pci0 dev 18 function 0 "NS SC1100 ISA" rev 0x00
gpio0 at gscpcib0: 64 pins
"NS SC1100 SMI" rev 0x00 at pci0 dev 18 function 1 not configured
pciide0 at pci0 dev 18 function 2 "NS SCx200 IDE" rev 0x01: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 1: <LEXAR ATA FLASH>
wd0: 16-sector PIO, LBA, 983MB, 2014992 sectors
wd0(pciide0:0:1): using PIO mode 4
geodesc0 at pci0 dev 18 function 5 "NS SC1100 X-Bus" rev 0x00: iid 6 revision 3 wdstatus 0 ohci0 at pci0 dev 19 function 0 "Compaq USB OpenHost" rev 0x08: irq 5, version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Compaq OHCI root hub, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
isa0 at gscpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
nsclpcsio0 at isa0 port 0x2e/2: NSC PC87366 rev 9: GPIO VLM TMS
gpio1 at nsclpcsio0: 29 pins
gscsio0 at isa0 port 0x15c/2: SC1100 SIO rev 1:
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom0: console
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
biomask f3e5 netmask ffe5 ttymask ffe7
pctr: no performance counters in CPU
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
WARNING: / was not properly unmounted
syncing disks... done
OpenBSD 4.1-stable (20070816) #0: Thu Aug 16 14:09:23 GMT 2007
    [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/20070816
cpu0: Geode(TM) Integrated Processor by National Semi ("Geode by NSC" 586-class) 267 MHz
cpu0: FPU,TSC,MSR,CX8,CMOV,MMX
cpu0: TSC disabled
real mem  = 133787648 (130652K)
avail mem = 114675712 (111988K)
using 1663 buffers containing 6811648 bytes (6652K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+ BIOS, date 20/41/06, BIOS32 rev. 0 @ 0xf7840
pcibios0 at bios0: rev 2.0 @ 0xf0000/0x10000
pcibios0: pcibios_get_intr_routing - function not supported
pcibios0: PCI IRQ Routing information unavailable.
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xc8000/0x9000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Cyrix GXm PCI" rev 0x00
sis0 at pci0 dev 6 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c1:ca:30
nsphyter0 at sis0 phy 0: DP83815 10/100 PHY, rev. 1
sis1 at pci0 dev 7 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c1:ca:31
nsphyter1 at sis1 phy 0: DP83815 10/100 PHY, rev. 1
sis2 at pci0 dev 8 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c1:ca:32
nsphyter2 at sis2 phy 0: DP83815 10/100 PHY, rev. 1
hifn0 at pci0 dev 14 function 0 "Hifn 7951" rev 0x01: LZS 3DES ARC4 MD5 SHA1 RNG PK, 128KB sram, irq 11
gscpcib0 at pci0 dev 18 function 0 "NS SC1100 ISA" rev 0x00
gpio0 at gscpcib0: 64 pins
"NS SC1100 SMI" rev 0x00 at pci0 dev 18 function 1 not configured
pciide0 at pci0 dev 18 function 2 "NS SCx200 IDE" rev 0x01: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 1: <LEXAR ATA FLASH>
wd0: 16-sector PIO, LBA, 983MB, 2014992 sectors
wd0(pciide0:0:1): using PIO mode 4
geodesc0 at pci0 dev 18 function 5 "NS SC1100 X-Bus" rev 0x00: iid 6 revision 3 wdstatus 0 ohci0 at pci0 dev 19 function 0 "Compaq USB OpenHost" rev 0x08: irq 5, version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Compaq OHCI root hub, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
isa0 at gscpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
nsclpcsio0 at isa0 port 0x2e/2: NSC PC87366 rev 9: GPIO VLM TMS
gpio1 at nsclpcsio0: 29 pins
gscsio0 at isa0 port 0x15c/2: SC1100 SIO rev 1:
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom0: console
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
biomask f3e5 netmask ffe5 ttymask ffe7
pctr: no performance counters in CPU
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
arplookup: unable to enter address for 169.254.25.100
arplookup: unable to enter address for 169.254.25.100
#


Did I mis-configure something?



-Chad

Reply via email to