[PHREAKSCRIPT-43] Add spanconfig command
Not sure if this is a DAHDI Tools / DAHDI Linux issue, but it's a DAHDI issue for sure.
Host: debian
Disabling auto-assignment completely screws up the kernel.
I went ahead and set the option in /etc/modprobe.d/dahdi.conf
to not autoload, but from cat /sys/module/dahdi/parameters/auto_assign_spans
, I could see it hadn't taken effect yet. I tried fully restarting DAHDI, but at some point, things seemed to get "stuck" (like, the kernel was completely unresponsive), so I hard shutdown the machine and powered it up again.
On the console, right after getting the login prompt, this started spewing down the screen:
2024-10-03T18:46:36.797782-04:00 debian dahdi[693]: D: auto '/sys/bus/dahdi_devices/devices/pci:0000:05:00.0'
2024-10-03T18:46:36.801224-04:00 debian dahdi[696]: auto-assign /sys/bus/dahdi_devices/devices/pci:0000:05:00.0
2024-10-03T18:46:36.802154-04:00 debian kernel: [ 41.849617] kobject_add_internal failed for span-1 (error: -2 parent: pci:0000:05:00.0)
2024-10-03T18:46:36.802166-04:00 debian kernel: [ 41.849670] ERR-dahdi: span-1: span_sysfs_create: device_register failed: -2
2024-10-03T18:46:36.802168-04:00 debian kernel: [ 41.849772] kobject_add_internal failed for span-1 (error: -2 parent: pci:0000:05:00.0)
2024-10-03T18:46:36.802173-04:00 debian kernel: [ 41.849804] ERR-dahdi: span-1: span_sysfs_create: device_register failed: -2
2024-10-03T18:46:36.802175-04:00 debian kernel: [ 41.849889] kobject_add_internal failed for span-1 (error: -2 parent: pci:0000:05:00.0)
2024-10-03T18:46:36.802176-04:00 debian kernel: [ 41.849921] ERR-dahdi: span-1: span_sysfs_create: device_register failed: -2
2024-10-03T18:46:36.802178-04:00 debian kernel: [ 41.850003] kobject_add_internal failed for span-1 (error: -2 parent: pci:0000:05:00.0)
2024-10-03T18:46:36.802179-04:00 debian kernel: [ 41.850035] ERR-dahdi: span-1: span_sysfs_create: device_register failed: -2
2024-10-03T18:46:36.802181-04:00 debian kernel: [ 41.850123] kobject_add_internal failed for span-1 (error: -2 parent: pci:0000:05:00.0)
...
It was much too fast to read it there, but I was able to log in and cat syslog to see what was going on.
This would go on forever and it seemed impossible to interact with the DAHDI service at all so I would have to hard reboot again (kill -9 on the pending dahdi_span_assignment command and even reboot would not work, so it was clear the kernel was completely hosed at this point).
Same thing on repeated reboots; I also made out warnings like "tormenta 2 unable to register" or "-EEXIST - don't try to register things with the same name in the same directory", stuff like that, but these would disappear pretty quickly by the time the login prompt showed up.
On one occasion, I ran "dahdi_span_assignments list" and this immediately said "Killed" and then the kernel hosed itself. The monitor basically filled up with white characters everywhere and all terminals stopped responding - another hard reboot.
I tried first with an empty assigned-spans.conf and then with one span in it, but that made no difference.
Only after I went back to /etc/modprobe.d/dahdi.conf, commented out the no autoload, and did a hard reboot (since normal reboots were impossible), did the system come up sanely and was usable. So, for the moment, it seems I can't disable autoloading on this particular system... or rather, something about its configuration really screws dahdi_span_assignments and friends up.
syslog logs on successful (autoload enabled) boot:
2024-10-03T18:49:30.572638-04:00 debian 'dahdi_handle_device'[329]: add: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0
2024-10-03T18:49:30.572659-04:00 debian 'dahdi_handle_device'[336]: auto_assign_spans=1. Skip /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0
2024-10-03T18:49:30.572682-04:00 debian 'dahdi_span_config'[352]: add: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-2
2024-10-03T18:49:30.572713-04:00 debian 'dahdi_span_config'[365]: add: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-1
2024-10-03T18:49:30.572735-04:00 debian 'dahdi_span_config'[368]: auto_assign_spans=1. Skip /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-2
2024-10-03T18:49:30.572766-04:00 debian 'dahdi_span_config'[367]: add: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-3
2024-10-03T18:49:30.572788-04:00 debian 'dahdi_span_config'[373]: auto_assign_spans=1. Skip /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-1
2024-10-03T18:49:30.572845-04:00 debian 'dahdi_span_config'[371]: add: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-4
2024-10-03T18:49:30.572877-04:00 debian 'dahdi_span_config'[376]: auto_assign_spans=1. Skip /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-3
2024-10-03T18:49:30.572906-04:00 debian 'dahdi_span_config'[383]: auto_assign_spans=1. Skip /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-4
2024-10-03T18:49:30.572927-04:00 debian 'dahdi_span_config'[390]: UNHANDLED: bind: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-2
2024-10-03T18:49:30.572948-04:00 debian 'dahdi_span_config'[396]: UNHANDLED: bind: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-3
2024-10-03T18:49:30.572977-04:00 debian 'dahdi_span_config'[406]: UNHANDLED: bind: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-1
2024-10-03T18:49:30.572998-04:00 debian 'dahdi_span_config'[408]: UNHANDLED: bind: /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/pci:0000:05:00.0/span-4
2024-10-03T18:49:30.573221-04:00 debian systemd-udevd[252]: /etc/udev/rules.d/dahdi.rules:5 Unknown user 'asterisk', ignoring
2024-10-03T18:49:30.573260-04:00 debian systemd-udevd[252]: /etc/udev/rules.d/dahdi.rules:5 Unknown group 'asterisk', ignoring
2024-10-03T18:49:30.574343-04:00 debian systemd[1]: Starting dahdi.service - LSB: DAHDI kernel modules...
2024-10-03T18:49:30.574467-04:00 debian dahdi[489]: Loading DAHDI hardware modules:
2024-10-03T18:49:30.578758-04:00 debian kernel: [ 17.867533] dahdi: loading out-of-tree module taints kernel.
2024-10-03T18:49:30.578770-04:00 debian kernel: [ 17.867838] dahdi: module verification failed: signature and/or required key missing - tainting kernel
2024-10-03T18:49:30.578774-04:00 debian kernel: [ 17.871386] dahdi: Version: 3.4.0
2024-10-03T18:49:30.578775-04:00 debian kernel: [ 17.872687] dahdi: Telephony Interface Registered on major 196
2024-10-03T18:49:40.924887-04:00 debian dahdi[749]: D: auto '/sys/bus/dahdi_devices/devices/pci:0000:05:00.0'
2024-10-03T18:49:41.181551-04:00 debian dahdi[752]: auto-assign /sys/bus/dahdi_devices/devices/pci:0000:05:00.0
2024-10-03T18:49:41.182220-04:00 debian kernel: [ 40.229961] dahdi_devices pci:0000:05:00.0: local span 1 is already assigned span 1
2024-10-03T18:49:41.182237-04:00 debian kernel: [ 40.229973] dahdi_devices pci:0000:05:00.0: local span 1 is already assigned span 2
2024-10-03T18:49:41.182240-04:00 debian kernel: [ 40.229976] dahdi_devices pci:0000:05:00.0: local span 1 is already assigned span 3
2024-10-03T18:49:41.182244-04:00 debian kernel: [ 40.229979] dahdi_devices pci:0000:05:00.0: local span 1 is already assigned span 4
2024-10-03T18:49:41.187770-04:00 debian dahdi[754]: using '/etc/dahdi/assigned-spans.conf'
2024-10-03T18:49:41.724490-04:00 debian dahdi[798]: Waiting for spans to become assigned: done
2024-10-03T18:49:42.583893-04:00 debian dahdi[489]: Running dahdi_cfg: .
2024-10-03T18:49:42.587281-04:00 debian systemd[1]: Started dahdi.service - LSB: DAHDI kernel modules.
Feedback from T Cohen:
Disabling a driver is simple (move driver away, blacklist it, whatever). Disabling a card: I'm not really sure.
Maybe it's possible to patch the bind function in the driver not to bind to it. Or maybe it is possible to write a minimal PCI driver and manually bind it to that card. See e.g. https://serverfault.com/questions/1080606/bind-unbind-pci-device-on-the-ubuntu-host
You must be