summaryrefslogtreecommitdiff
path: root/packages/openpbx/files
diff options
context:
space:
mode:
authorJustin Patrin <papercrane@gmail.com>2007-03-19 05:14:26 +0000
committerJustin Patrin <papercrane@gmail.com>2007-03-19 05:14:26 +0000
commitf757c62cc9f18deebdaef52364e694947342d99e (patch)
treea07f8c3fc646596d4ccef42423db2490ab166140 /packages/openpbx/files
parent8783f89808493b0ccd5f31298851cdd6b61dfeeb (diff)
parent5fb7f282ceab4ad5655ef46c04d14fc51bc4c245 (diff)
merge of '3d8929bfa9340617185c89d3812c28b27c5b5f56'
and 'ebcce1007fcce84849ea57fa3d8bfc60cf7001a9'
Diffstat (limited to 'packages/openpbx/files')
-rw-r--r--packages/openpbx/files/.mtn2git_empty0
-rw-r--r--packages/openpbx/files/init75
-rw-r--r--packages/openpbx/files/logrotate13
-rw-r--r--packages/openpbx/files/volatiles6
4 files changed, 94 insertions, 0 deletions
diff --git a/packages/openpbx/files/.mtn2git_empty b/packages/openpbx/files/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/openpbx/files/.mtn2git_empty
diff --git a/packages/openpbx/files/init b/packages/openpbx/files/init
new file mode 100644
index 0000000000..0ce88c4626
--- /dev/null
+++ b/packages/openpbx/files/init
@@ -0,0 +1,75 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/openpbx and type
+# > update-rc.d openpbx defaults 60
+#
+openpbx=/usr/sbin/openpbx
+pidfile=/var/run/openpbx.org/openpbx.pid
+
+test -x "$openpbx" || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting OpenPBX"
+ start-stop-daemon --start --quiet --exec $openpbx -- -npq
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping OpenPBX"
+ $openpbx -rx "stop gracefully"
+ sleep 4
+ if [ -f $pidfile ]; then
+ start-stop-daemon --stop --quiet --pidfile $pidfile
+ fi
+ echo "."
+ ;;
+ force-stop)
+ echo -n "Stopping OpenPBX"
+ $openpbx -rx "stop now"
+ sleep 2
+ if [ -f $pidfile ]; then
+ start-stop-daemon --stop --quiet --pidfile $pidfile
+ fi
+ echo "."
+ ;;
+ restart)
+ echo -n "Restarting OpenPBX"
+ if [ -f $pidfile ]; then
+ $openpbx -rx "restart gracefully"
+ sleep 2
+ else
+ start-stop-daemon --start --quiet --exec $openpbx -- -npq
+ fi
+ ;;
+ force-restart)
+ echo -n "Forcibly Restarting OpenPBX"
+ if [ -f $pidfile ]; then
+ $openpbx -rx "restart now"
+ sleep 2
+ else
+ start-stop-daemon --start --quiet --exec $openpbx -- -npq
+ fi
+ ;;
+ reload)
+ echo -n "Reloading OpenPBX Configuration"
+ if [ -f $pidfile ]; then
+ $openpbx -rx "reload"
+ else
+ start-stop-daemon --start --quiet --exec $openpbx -- -npq
+ fi
+ echo "."
+ ;;
+ logger-reload)
+# echo -n "Restating OpenPBX Logger"
+ if [ -f $pidfile ]; then
+ $openpbx -rx "logger reload"
+ fi
+# echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/openpbx {start|stop|force-stop|restart|force-restart|reload|logger-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/packages/openpbx/files/logrotate b/packages/openpbx/files/logrotate
new file mode 100644
index 0000000000..a0192538a3
--- /dev/null
+++ b/packages/openpbx/files/logrotate
@@ -0,0 +1,13 @@
+/var/log/openpbx.org/cdr-csv/Master.csv /var/log/openpbx.org/queue_log /var/log/openpbx.org/event_log /var/log/openpbx.org/messages
+/var/log/openpbx.org/full {
+ daily
+ missingok
+ compress
+ delaycompress
+ rotate 30
+ sharedscripts
+ postrotate
+ /etc/init.d/openpbx logger-reload
+ endscript
+}
+
diff --git a/packages/openpbx/files/volatiles b/packages/openpbx/files/volatiles
new file mode 100644
index 0000000000..716d469e86
--- /dev/null
+++ b/packages/openpbx/files/volatiles
@@ -0,0 +1,6 @@
+d openpbx openpbx 0775 /var/run/openpbx.org none
+d openpbx openpbx 0775 /var/lib/openpbx.org none
+d openpbx openpbx 0775 /var/log/openpbx.org/cdr-csv none
+d openpbx openpbx 0775 /var/log/openpbx.org/cdr-custom none
+d openpbx openpbx 0775 /var/spool/openpbx.org/outgoing none
+d openpbx openpbx 0775 /var/spool/openpbx.org/voicemail none