[asterisk-dev] zaptel helper script

Oron Peled oron at actcom.co.il
Fri Oct 27 14:06:25 MST 2006


I'll try to augment what Tzafrir said...

On Friday, 27 בOctober 2006 22:23, Tzafrir Cohen wrote:
> > I'm confused. The only file attached to the bug report is a script, not
> > a binary.

Of course it is. The question is in which script should we implement
this functionality?
 - /etc/init.d/zaptel
 - a separate script that may be called from /etc/init.d/zaptel
   and other places.

> > You lost me. There is no "unload" in /etc/init.d/zaptel.

This is only one of the extra functions that are needed, the script
shows some more examples.

> You see, an init.d script is not the right place for it. Not to mention
> the fact that init.d script*s* are distro-specific.

Sure. Most distros write their own init.d scripts, since they contain
glue logic for their boot policy. Examples:
 - Returning specific values (e.g: in RedHat/Fedora to create the
   colored boot list (OK, FAIL, etc.)
 - Using distro specific utilities (e.g: in debian using start-stop-daemon
   wrapper).
 - Maybe not a SysV script at all (e.g: *BSD boot scripts, an embeded
   system with minimal scripts, or init-ng).

Therefore it's important to split the logical operations to a separate
script. E.g:
 - Load/Unload drivers.
 - Waiting until they finished hardware probing (so we can generate
   configuration for the detected devices).
 - Running driver config (ztcfg, fxotune, etc.) Note that this may be
   needed separately from driver load/unload (e.g: after a configuration
   file change).

The script (or scripts) that would implement this logic would be the
building blocks for any platform that want to integrate asterisk into
its boot framework. In most cases they would make the /etc/init.d/zaptel
trivial. But they may be called from other places (e.g: genzaptelconf,
FreePBX, etc.) to ease the administration.

-- 
Oron Peled                             Voice/Fax: +972-4-8228492
oron at actcom.co.il                  http://www.actcom.co.il/~oron
ICQ UIN: 16527398

"If I have been able to see farther,
it was only because I stood on the shoulders of giants."
	-- Sir Isaac Newton


More information about the asterisk-dev mailing list