Commit Graph

2 Commits

Author SHA1 Message Date
Oron Peled
754d981621 Avoid a race between /etc/init.d/dahdi and hotplug scripts:
* On some systems/configurations, dahdi init script may kick in
  during the time that hotplug scripts are configuring spans.

* It may lead to a race since the init script runs "dahdi_auto_assign_compat"
  which calls "dahdi_registration" and that tries to run
  "dahdi_span_assignments auto ..."

* Use the newly-added "dahdi_span_assignments" "unmatched" operation.

* Now the "dahdi_auto_assign_compat" script only runs "dahdi_registration"
  if there are no "unmatched" Astribanks.

* This prevents the race in fully configured systems.
  The race may still exist on partially-configured systems.
2017-08-31 19:00:02 +03:00
Oron Peled
1292ea9078 registration-order: Added dahdi_auto_assign_compat
Maintains the original registration order as was before span
assignments. Should allow seemless trannsition to
dahdi.auto_assign_spans=0

* The idea:
  - We stop handling in udev the case of missing
    /etc/dahdi/assigned-spans.conf
  - Instead we rely on "registration_time" dahdi_device attribute from
    DAHDI-linux
  - Then, we can sort the devices and assign their spans in
    /etc/init.d/dahdi
* Mechanics:
  - From /etc/init.d/dahdi, we run a new 'dahdi_auto_assign_compat'
    script (after "waitfor_xpds" etc.)
  - In this script we "auto" assign spans of non-Astribank devices
  - In the end of the script we run "dahdi_registration" which
    does the same for Astribank devices.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-03-25 14:51:29 +02:00