From 870a5b6c2de48bacfe42c40020230b5baf2a811b Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Fri, 12 Jun 2009 19:42:26 +0000 Subject: [PATCH] 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200428 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- contrib/upstart/asterisk.upstart-0.3.9 | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 contrib/upstart/asterisk.upstart-0.3.9 diff --git a/contrib/upstart/asterisk.upstart-0.3.9 b/contrib/upstart/asterisk.upstart-0.3.9 new file mode 100644 index 0000000000..4f75b3134e --- /dev/null +++ b/contrib/upstart/asterisk.upstart-0.3.9 @@ -0,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 + +post-stop script + # Might as well clean up after ourselves, too. + rm -rf /var/run/asterisk +end script