ports/181160: Port sysutils/bacula-client - All bacula-fd processes killed when upgrading port

Kai k at free.de
Fri Aug 9 12:00:02 UTC 2013


>Number:         181160
>Category:       ports
>Synopsis:       Port sysutils/bacula-client - All bacula-fd processes killed when upgrading port
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 09 12:00:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Kai
>Release:        9.1
>Organization:
>Environment:
Copyright (c) 1992-2013 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.1-STABLE #0: Sun Feb 24 09:20:25 CET 2013
    kgal at gemuetlich.free.de:/usr/obj/usr/src/sys/Q6600 amd64
CPU: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz (2394.05-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x6fb  Family = 0x6  Model = 0xf  Stepping = 11
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0xe3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM>
  AMD Features=0x20100800<SYSCALL,NX,LM>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant, performance statistics
real memory  = 8589934592 (8192 MB)
avail memory = 8249102336 (7866 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: <PTLTD  	 APIC  >
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
 cpu2 (AP): APIC ID:  2
 cpu3 (AP): APIC ID:  3
ioapic0 <Version 2.0> irqs 0-23 on motherboard
ioapic1 <Version 2.0> irqs 24-47 on motherboard
kbd1 at kbdmux0
cryptosoft0: <software crypto> on motherboard
acpi0: <PTLTD   RSDT> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43,0x50-0x53 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 450
Event timer "HPET1" frequency 14318180 Hz quality 440
Event timer "HPET2" frequency 14318180 Hz quality 440
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 16 at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pcib2: <ACPI PCI-PCI bridge> irq 17 at device 28.0 on pci0
pci9: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 0.0 on pci9
pci10: <ACPI PCI bus> on pcib3
em0: <Intel(R) PRO/1000 Legacy Network Connection 1.0.4> port 0x4000-0x403f mem 0xe0240000-0xe025ffff,0xe0200000-0xe023ffff irq 24 at device 1.0 on pci10
em0: Ethernet address: 00:11:0a:5d:00:fc
em1: <Intel(R) PRO/1000 Legacy Network Connection 1.0.4> port 0x4040-0x407f mem 0xe0260000-0xe027ffff irq 25 at device 1.1 on pci10
em1: Ethernet address: 00:11:0a:5d:00:fd
pcib4: <ACPI PCI-PCI bridge> irq 17 at device 28.4 on pci0
pci13: <ACPI PCI bus> on pcib4
em2: <Intel(R) PRO/1000 Network Connection 7.3.2> port 0x5000-0x501f mem 0xe0300000-0xe031ffff irq 16 at device 0.0 on pci13
em2: Using an MSI interrupt
em2: Ethernet address: 00:30:48:91:5a:da
pcib5: <ACPI PCI-PCI bridge> irq 16 at device 28.5 on pci0
pci14: <ACPI PCI bus> on pcib5
em3: <Intel(R) PRO/1000 Network Connection 7.3.2> port 0x6000-0x601f mem 0xe0400000-0xe041ffff irq 17 at device 0.0 on pci14
em3: Using an MSI interrupt
em3: Ethernet address: 00:30:48:91:5a:db
uhci0: <Intel 82801G (ICH7) USB controller USB-A> port 0x3000-0x301f irq 23 at device 29.0 on pci0
usbus0 on uhci0
uhci1: <Intel 82801G (ICH7) USB controller USB-B> port 0x3020-0x303f irq 19 at device 29.1 on pci0
usbus1 on uhci1
uhci2: <Intel 82801G (ICH7) USB controller USB-C> port 0x3040-0x305f irq 18 at device 29.2 on pci0
usbus2 on uhci2
uhci3: <Intel 82801G (ICH7) USB controller USB-D> port 0x3060-0x307f irq 16 at device 29.3 on pci0
usbus3 on uhci3
ehci0: <Intel 82801GB/R (ICH7) USB 2.0 controller> mem 0xe0000000-0xe00003ff irq 23 at device 29.7 on pci0
usbus4: EHCI version 1.0
usbus4 on ehci0
pcib6: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci15: <ACPI PCI bus> on pcib6
vgapci0: <VGA-compatible display> port 0x7000-0x70ff mem 0xe8000000-0xefffffff,0xe0500000-0xe050ffff irq 16 at device 0.0 on pci15
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
ahci0: <Intel ICH7 AHCI SATA controller> port 0x30c0-0x30c7,0x30b4-0x30b7,0x30b8-0x30bf,0x30b0-0x30b3,0x30a0-0x30af mem 0xe0000400-0xe00007ff irq 19 at device 31.2 on pci0
ahci0: AHCI v1.10 with 4 3Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
acpi_button0: <Power Button> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (9600,n,8,1)
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
ipmi0: <IPMI System Interface> on isa0
ipmi0: KCS mode found at io 0xca8 alignment 0x4 on isa
orm0: <ISA Option ROMs> at iomem 0xc0000-0xcafff,0xcb000-0xcc7ff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ppc0: cannot reserve I/O port range
ctl: CAM Target Layer loaded
coretemp0: <CPU On-Die Thermal Sensors> on cpu0
est0: <Enhanced SpeedStep Frequency Control> on cpu0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
coretemp1: <CPU On-Die Thermal Sensors> on cpu1
est1: <Enhanced SpeedStep Frequency Control> on cpu1
p4tcc1: <CPU Frequency Thermal Control> on cpu1
coretemp2: <CPU On-Die Thermal Sensors> on cpu2
est2: <Enhanced SpeedStep Frequency Control> on cpu2
p4tcc2: <CPU Frequency Thermal Control> on cpu2
coretemp3: <CPU On-Die Thermal Sensors> on cpu3
est3: <Enhanced SpeedStep Frequency Control> on cpu3
p4tcc3: <CPU Frequency Thermal Control> on cpu3
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
Timecounters tick every 1.000 msec
IPsec: Initialized Security Association Processing.
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <Intel> at usbus1
uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 12Mbps Full Speed USB v1.0
ugen2.1: <Intel> at usbus2
uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <Intel> at usbus3
uhub3: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
usbus4: 480Mbps High Speed USB v2.0
ugen4.1: <Intel> at usbus4
uhub4: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4
uhub0: 2 ports with 2 removable, self powered
ipmi0: IPMI device rev. 0, firmware rev. 14.44, version 2.0
uhub1: 2 ports with 2 removable, self powered
ipmi0: Number of channels 4
ipmi0: Attached watchdog
uhub2: 2 ports with 2 removable, self powered
uhub3: 2 ports with 2 removable, self powered
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <ST31000340NS SN06> ATA-8 SATA 1.x device
ada0: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad4
SMP: AP CPU #3 Launched!
SMP: AP CPU #2 Launched!
SMP: AP CPU #1 Launched!
Timecounter "TSC-low" frequency 1197023778 Hz quality 1000
Root mount waiting for: usbus4
Root mount waiting for: usbus4
Root mount waiting for: usbus4
uhub4: 8 ports with 8 removable, self powered
Trying to mount root from zfs:rpool/ROOT/9-STABLE-20130222 []...
em0: link state changed to DOWN
lagg0: link state changed to DOWN
vlan6: link state changed to DOWN
em0: link state changed to UP
lagg0: link state changed to UP
vlan6: link state changed to UP
pid 90649 (try), uid 0: exited on signal 10
pid 62402 (try), uid 0: exited on signal 10
pid 91652 (try), uid 0: exited on signal 10
Limiting closed port RST response from 221 to 200 packets/sec
Limiting closed port RST response from 556 to 200 packets/sec
Limiting closed port RST response from 518 to 200 packets/sec
Limiting closed port RST response from 358 to 200 packets/sec
Limiting closed port RST response from 489 to 200 packets/sec
Limiting closed port RST response from 251 to 200 packets/sec
Limiting closed port RST response from 268 to 200 packets/sec
Limiting closed port RST response from 291 to 200 packets/sec
pid 13135 (try), uid 0: exited on signal 10
pid 24799 (try), uid 0: exited on signal 10
pid 35132 (try), uid 0: exited on signal 10
pid 35369 (try), uid 0: exited on signal 10
pid 43398 (try), uid 0: exited on signal 10
pid 14157 (try), uid 0: exited on signal 10
Limiting closed port RST response from 201 to 200 packets/sec
Limiting closed port RST response from 227 to 200 packets/sec
Limiting closed port RST response from 206 to 200 packets/sec
Limiting closed port RST response from 224 to 200 packets/sec
Limiting closed port RST response from 244 to 200 packets/sec
ugen4.2: <JetFlash> at usbus4
umass0: <JetFlash Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2> on usbus4
umass0:  SCSI over Bulk-Only; quirks = 0x4100
umass0:5:0:-1: Attached to scbus5
da0 at umass-sim0 bus 0 scbus5 target 0 lun 0
da0: <JetFlash Transcend 4GB 8.07> Removable Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 3830MB (7843840 512 byte sectors: 255H 63S/T 488C)
>Description:
* FreeBSD Port sysutils/bacula-client and "killall" in pkg-plist.client *

Upgrading bacula-client on a jail server running jails with other bacula-client processes ("bacula-fd") kills all bacula-cient processes. They do not get restartet afer upgrading..


$cat /usr/ports/sysutils/bacula-server/pkg-plist.client

lib/libbac.la
lib/libbac.so
lib/libbac.so.%%MAJOR%%
lib/libbaccfg.la
lib/libbaccfg.so
lib/libbaccfg.so.%%MAJOR%%
lib/libbacfind.la
lib/libbacfind.so
lib/libbacfind.so.%%MAJOR%%
lib/libbacpy.la
lib/libbacpy.so
lib/libbacpy.so.%%MAJOR%%
lib/bpipe-fd.so
sbin/bacula-fd
sbin/bconsole
@unexec /usr/bin/killall bacula-fd > /dev/null 2>&1 || true
@exec mkdir -p %%BACULA_DIR%%
@dirrmtry %%BACULA_DIR%%
@dirrmtry share/bacula

Here you are using "@unexec /usr/bin/killall bacula-fd > /dev/null 2>&1 || true"

I maintain some multijail-servers hosting about 50 jails per server and I have bacula-client running on the jail-host itself and also inside on a great part of the jails (because this makes it easier for me to relocate jails to different jail-hosts and not having to worry that they are actually being backepd up, also because bacula-server becomes unusable slow when restoring to a bacula-client hosting millions of files or many jails - I guess database limitations.)

If I do a pkg upgrade of bacula-client on the jail-host, "killall" is killing all running bacula-fd processes on the jailhost, also the bacula-fd processes inside all of the jails.


>How-To-Repeat:
Upgrade bacula-client on a jail-host running bacula-client inside hosted jails.
>Fix:
I  propose the following patch for pkg-plist.client:

--- pkg-plist.client	2012-12-16 17:32:45.000000000 +0100
+++ pkg-plist.client.patched	2013-07-08 11:25:05.092088611 +0200
@@ -13,7 +13,7 @@
lib/bpipe-fd.so
sbin/bacula-fd
sbin/bconsole
- at unexec /usr/bin/killall bacula-fd > /dev/null 2>&1 || true
+ at unexec kill `cat /var/run/bacula-fd*.pid` > /dev/null 2>&1 || true
@exec mkdir -p %%BACULA_DIR%%
@dirrmtry %%BACULA_DIR%%
@dirrmtry share/bacula

This of course makes the assumption that there is bacula-fd .pid file in /var/run

Looking at /usr/local/etc/bacula-fd.conf.sample I assume it is the common case that users have
"Pid Directory = /var/run" confuigured into bacula-fd.conf

The more universal solution would be to come up with a short script that a) uses pkill for killing purposes  b) checks if it is running inside or outside a jail (sysctl) c) makes sure pkill only shoots down the wanted bacula-fd process inside (jailed) or outside (host).

Besides: Why not use the bacula rc script in /usr/local/etc/rc.d/ for stopping/starting bacula-client?
I think this could be achieved by using "@stopdaemon bacula-fd" in pkg-plist.client

I'd favour a solution where portupgrade stops bacula-fd by using the rc script, upgrades the port and then starts bacula-fd (also by rc script).

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list