[asterisk-dev] upstart script [was: Re: [svn-commits] seanbright: trunk r200428 - in /trunk/contrib/upstart: ./ asterisk.upstart-0.3.9]

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sat Jun 13 03:41:08 CDT 2009


On Fri, Jun 12, 2009 at 07:42:41PM -0000, SVN commits to the Digium repositories wrote:
> Author: seanbright
> Date: Fri Jun 12 14:42:26 2009
> New Revision: 200428
> 
> URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200428
> Log:
> First shot at an upstart script for asterisk on Ubuntu.
> 
> This works relatively well (assuming you are using /var/run/asterisk) as your
> run directory and upstart 0.3.9.  Needs to be generalized and eventually added
> to the 'make install' target for Ubuntu.

Nice

> 
> Added:
>     trunk/contrib/upstart/
>     trunk/contrib/upstart/asterisk.upstart-0.3.9   (with props)
> 
> Added: trunk/contrib/upstart/asterisk.upstart-0.3.9
> URL: http://svn.asterisk.org/svn-view/asterisk/trunk/contrib/upstart/asterisk.upstart-0.3.9?view=auto&rev=200428
> ==============================================================================
> --- trunk/contrib/upstart/asterisk.upstart-0.3.9 (added)
> +++ trunk/contrib/upstart/asterisk.upstart-0.3.9 Fri Jun 12 14:42:26 2009
> @@ -1,0 +1,28 @@
> +# asterisk
> +#
> +# Upstart control file for the Asterisk PBX
> +
> +description "Asterisk PBX"
> +version     "1.6.3"
> +
> +start on runlevel 2
> +start on runlevel 3
> +start on runlevel 4
> +start on runlevel 5
> +
> +stop on runlevel 0
> +stop on runlevel 1
> +stop on runlevel 6
> +
> +pre-start script
> +  # Since Ubuntu clears /var/run on reboot, create this before we try to start
> +  mkdir -p /var/run/asterisk
> +end script
> +
> +respawn
> +exec /usr/sbin/asterisk -vvvvvvvg -cf

-c is needed. -f is a bit unnecessary, then. The v-s should not be
enabled by default. By default we want to see the important messages.

Where is the output of the console going to? Is it rotated?

> +
> +post-stop script
> +  # Might as well clean up after ourselves, too.
> +  rm -rf /var/run/asterisk

What happens if you have more than one Asterisk running?

> +end script

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-dev mailing list