Installing Asterisk - Daemon Tools

From KoshWiki

Jump to: navigation, search

Contents

Description

Setting up Asterisk in Daemontools[1] is definitely the way to go.

Setting up Asterisk in Daemontools

Installing Daemontools

# apt-get install daemontools-installer

which will end with ..

To build daemontools binary package, you have to run

         build-daemontools

Run the build script and just hit enter the whole way through

# build-daemontools

which ends with ...

Good luck!

Setting up the Asterisk Service

Now to create the service directory and contents...

# cd /tmp
# /bin/mkdir -p asterisk/log/env
# /bin/echo -e "#`/bin/echo -n \!`/bin/sh\nsleep 10\n/usr/sbin/asterisk -vvvvvvvvvvgf -U asterisk\n" > asterisk/run

then copy paste the following into an editor.

#!/bin/sh
exec \
envdir ./env \
sh -c '
    exec \
    multilog \
        t \
        ${MAXFILESIZE+"s$MAXFILESIZE"} \
        ${MAXLOGFILES+"n$MAXLOGFILES"} \
        ${PROCESSOR+"!$PROCESSOR"} \
        ./main
'

((Example Editor Line))

# nano -w asterisk/log/run

.. and continuing ..

# /bin/chmod 0755 asterisk/run asterisk/log/run
# /bin/mkdir /var/log/asterisk/console
# /bin/chown asterisk:asterisk /var/log/asterisk/console
# /bin/ln -s /var/log/asterisk/console asterisk/log/main
# /bin/echo "10000000" > asterisk/log/env/MAXFILESIZE && \
  /bin/echo "10" > asterisk/log/env/MAXLOGFILES && \
  /bin/echo > asterisk/log/env/PROCESSOR

Then we move the directory into the /service/ directory, and then run svstat a few times until it's running.

# /bin/mv asterisk/ /service/
# /usr/bin/svstat /service/*
/service/asterisk: unable to open supervise/ok: file does not exist
# /usr/bin/svstat /service/*
/service/asterisk: up (pid 18568) 1 seconds
# svstat /service/*
/service/asterisk: up (pid 18568) 88 seconds

References

  1. daemontools
Personal tools