I'm running hotplugd on 5.2-current snapshot build from Aug 1. As I was
configuring it, I found that I could not terminate a running hotplugd and
then start it, nor could I restart it from
"/etc/rc.d/hotplugd restart".

Looking at the source, it seems that hotplugd is expecting SIGQUIT in
order to shutdown cleanly and move into reaching close(devfd), but it
appears to still have a hold on /dev/hotplug even when it gets SIGQUIT,
and then cannot reopen the busy device to start again.

Any thoughts on how to get hotplugd to restart cleanly?

Thanks!
CW

$ pgrep hotplugd
27888
$ sudo pkill hotplugd -SIGQUIT
$ grep "terminated" /var/log/daemon
Aug  6 13:53:32 zaccheus hotplugd[27888]: terminated
$ sudo /usr/sbin/hotplugd
hotplugd: /dev/hotplug: Device busy
$ sudo /etc/rc.d/hotplugd start
hotplugd(failed)

Reboot and get hotplugd working again:
$ pgrep hotplugd
26187
$ grep "terminated" /var/log/daemon   ### Logfile rotated
$ sudo /etc/rc.d/hotplugd restart
hotplugd(ok)
hotplugd(failed)
$ grep "terminated" /var/log/daemon
Aug  6 14:01:08 zaccheus hotplugd[26187]: terminated
$ sudo /usr/sbin/hotplugd
hotplugd: /dev/hotplug: Device busy

$ dmesg
OpenBSD 5.2 (GENERIC) #278: Wed Aug  1 10:04:16 MDT 2012
    dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60
GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,NXE,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,xTPR,PDCM,MOVBE,LAHF
real mem  = 1063645184 (1014MB)
avail mem = 1035407360 (987MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 03/05/10, BIOS32 rev. 0 @ 0xfdc40,
SMBIOS rev. 2.5 @ 0xdf010 (24 entries)
bios0: vendor LENOVO version "14CN97WW" date 03/05/2010
bios0: LENOVO 41872NU
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET MCFG TCPA TMOR APIC BOOT ASF! SSDT SSDT SSDT
acpi0: wakeup devices HDEF(S4) PXS1(S4) PXS2(S4) PXS3(S4) USB1(S3)
USB7(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 132MHz
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (RP01)
acpiprt2 at acpi0: bus 3 (RP02)
acpiprt3 at acpi0: bus 5 (RP03)
acpiprt4 at acpi0: bus 6 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, C1, PSS
acpitz0 at acpi0: critical temperature is 86 degC
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: SLPB
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "LE60_C" serial   type LION oem "Celxpert"
acpibtn2 at acpi0: LID_
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD04
bios0: ROM list: 0xc0000/0xec00! 0xcf000/0x1e00 0xdf000/0x800!
0xe0000/0x1800!
cpu0: Enhanced SpeedStep 1597 MHz: speeds: 1600, 1333, 1067, 800 MHz pci0
at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82945GME Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82945GME Video" rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 2 int 16
drm0 at inteldrm0
"Intel 82945GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: msi
azalia0: codecs: Realtek ALC269
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 2 int 17
pci1 at ppb0 bus 2
bge0 at pci1 dev 0 function 0 "Broadcom BCM5906M" rev 0x02, BCM5906 A2
(0xc002): apic 2 int 16, address 00:23:8b:83:5f:90
brgphy0 at bge0 phy 1: BCM5906 10/100baseTX PHY, rev. 0
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 2 int 16
pci2 at ppb1 bus 3
ppb2 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02: apic 2 int 18
pci3 at ppb2 bus 5
"Broadcom BCM4315" rev 0x01 at pci3 dev 0 function 0 not configured uhci0
at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2 int
19
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2 int 16
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2 pci4
at ppb3 bus 6
ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x02: DMA,
channel 0 configured to compatibility, channel 1 configured to
compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 ignored (disabled)
pciide1 at pci0 dev 31 function 2 "Intel 82801GBM SATA" rev 0x02: DMA,
channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 2 int 19 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: <WDC WD1600BEVS-08VAT2>
wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 6
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic 2
int 19
iic0 at ichiic0
iic0: addr 0x4a 00=31 01=00 02=4b 03=50 04=50 05=50 06=50 07=50 08=50
09=50 0a=50 0b=50 0c=50 0d=50 0e=50 0f=50 22=4b 40=31 41=00 42=4b 43=50
44=50 45=50 46=50 47=50 48=31 49=50 4a=31 4b=50 4c=50 4d=50 4e=31 4f=50
ee=00 words 00=4e80 01=3000 02=4b00 03=5000 04=5000 05=5000 06=5000
07=5000
spdmem0 at iic0 addr 0x51: 512MB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
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, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pms0: Synaptics touchpad, firmware 7.2
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
run0 at uhub0 port 1 "Ralink 802.11 n WLAN" rev 2.00/1.01 addr 2
run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 1T1R), address
00:24:a5:76:54:cc
umass0 at uhub0 port 2 configuration 1 interface 0 "SMI Corporation USB
DISK" rev 2.00/11.00 addr 3
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SMI, USB DISK, 1100> SCSI0 0/direct
removable serial.090c1000012700007437
sd0: 991MB, 512 bytes/sector, 2030592 sectors
uvideo0 at uhub0 port 3 configuration 1 interface 0 "Image Processor
Lenovo EasyCamera" rev 2.00/28.67 addr 4
video0 at uvideo0
umass1 at uhub0 port 5 configuration 1 interface 0 "Generic USB2.0-CRW"
rev 2.00/58.87 addr 5
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Generic-, Multi-Card, 1.00> SCSI0 0/direct
removable serial.0bda0158114173400000
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
sd2 at scsibus3 targ 1 lun 0: <OPENBSD, SR CRYPTO, 005> SCSI2 0/direct fixed
sd2: 151142MB, 512 bytes/sector, 309539892 sectors
root device (default wd0a): sd2a
swap device (default sd2b): wd0b
root on sd2a swap on wd0b dump on wd0b

Reply via email to