]> git.pld-linux.org Git - packages/asterisk.git/commitdiff
- init scripts for asterisk
authorPaweł Gołaszewski <blues@pld-linux.org>
Tue, 13 May 2003 10:53:28 +0000 (10:53 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    asterisk.init -> 1.1
    asterisk.sysconfig -> 1.1

asterisk.init [new file with mode: 0644]
asterisk.sysconfig [new file with mode: 0644]

diff --git a/asterisk.init b/asterisk.init
new file mode 100644 (file)
index 0000000..8d0f9df
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# asterix      This shell script takes care of starting and stopping
+#              Asterisk PBX
+#
+# chkconfig:   345 90 25
+#
+# description: Asterisk is an Open Source PBX and telephony development platform that
+#              can both replace a conventional PBX and act as a platform for
+#              developing custom telephony applications for delivering dynamic
+#              content over a telephone similarly to how one can deliver dynamic
+#              content through a web browser using CGI and a web server.
+#              
+# pidfile:     /var/run/asterisk.pid
+# config:      /etc/asterisk/asterisk.conf
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/asterisk ] && . /etc/sysconfig/asterisk
+
+# Check that networking is up.
+if is_no "${NETWORKING}"; then
+       msg_network_down Asterisk
+       exit 1
+fi
+
+# Sanity check
+[ -f /etc/asterisk/asterisk.conf ] || exit 0
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/asterisk ]; then
+               msg_starting Asterisk
+               busy            
+               daemon $SERVICE_RUN_NICE_LEVEL asterisk $ASTERISK_OPTS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
+       else
+               msg_already_running Asterisk
+       fi
+       ;;
+  stop)
+       # Stop daemons.
+       if [ -f /var/lock/subsys/asterisk ]; then
+               msg_stopping Asterisk
+               killproc asterisk
+               rm -f /var/lock/subsys/asterisk >/dev/null 2>&1
+       else
+               msg_not_running Asterisk
+               exit 1
+       fi
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       ;;
+  reload)
+       # Should be some better way...
+       $0 restart
+#      if [ -f /var/lock/subsys/ ]; then
+#              msg_reloading Asterisk
+#              busy
+#              ok
+#      else
+#              msg_not_running Asterisk
+#              exit 1
+#      fi
+       ;;
+  status)
+       status asterisk
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|status|restart|reload}"
+       exit 1
+esac
+
+exit $RETVAL
diff --git a/asterisk.sysconfig b/asterisk.sysconfig
new file mode 100644 (file)
index 0000000..2e897d3
--- /dev/null
@@ -0,0 +1,5 @@
+# Asterisk startup configuration file
+
+# Try to define nice-level for running asterisk
+SERVICE_RUN_NICE_LEVEL="+5"
+
This page took 0.091536 seconds and 4 git commands to generate.