aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mason <ms13sp@gmail.com>2009-07-14 18:37:57 +0000
committerMichael Mason <ms13sp@gmail.com>2009-07-14 18:37:57 +0000
commit12058bc904a1ae0793e0c6ebb173846bc001f6e3 (patch)
tree5d22c283ab4b22d5ddb62e88807cffb377e1a570
parentc1e4d08dd5272afb145baf947e4aff83f5cfd661 (diff)
downloadaports-12058bc904a1ae0793e0c6ebb173846bc001f6e3.tar.bz2
aports-12058bc904a1ae0793e0c6ebb173846bc001f6e3.tar.xz
extra/iaxmodem Updated to included conf.d and init.d files
-rw-r--r--extra/iaxmodem/iaxmodem.confd7
-rw-r--r--extra/iaxmodem/iaxmodem.initd43
2 files changed, 50 insertions, 0 deletions
diff --git a/extra/iaxmodem/iaxmodem.confd b/extra/iaxmodem/iaxmodem.confd
new file mode 100644
index 0000000000..082a920e0b
--- /dev/null
+++ b/extra/iaxmodem/iaxmodem.confd
@@ -0,0 +1,7 @@
+# Configfile for /etc/init.d/iaxmodem
+
+# Set the priority of the iaxmodem process
+# Value: (highest) -20..19 (lowest)
+#
+#IAXMODEM_NICE="-5"
+
diff --git a/extra/iaxmodem/iaxmodem.initd b/extra/iaxmodem/iaxmodem.initd
new file mode 100644
index 0000000000..d6f2c947ac
--- /dev/null
+++ b/extra/iaxmodem/iaxmodem.initd
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-misc/iaxmodem/files/iaxmodem.initd,v 1.1 2008/10/14 23:53:39 sbriesen Exp $
+
+description="IAXmodem"
+description_reload="Reread configuration file and make the appropriate changes"
+extra_started_commands="reload"
+command="/usr/sbin/iaxmodem"
+pidfile="/var/run/iaxmodem.pid"
+name="iaxmodem"
+
+depend() {
+ use asterisk
+ need net
+}
+
+start() {
+ ebegin "Starting ${description}"
+ start-stop-daemon --start --quiet --pidfile "${pidfile}" \
+ --env TMPDIR="/tmp" --nice ${IAXMODEM_NICE:-0} --exec "${command}"
+ eend ${?}
+}
+
+stop() {
+ local childs=""
+ ebegin "Stopping ${description}"
+ # start-stop-daemon doesn't kill childs reliable, so we
+ # use a combination of pgrep + start-stop-daemon + kill
+ [ -s "${pidfile}" ] && childs=$(pgrep -P $(cat "${pidfile}"))
+ start-stop-daemon --stop --quiet --pidfile "${pidfile}" --retry TERM/10/KILL/5
+ if eend ${?}; then
+ # if there're still childs running, kill them!
+ [ -n "${childs}" ] && kill -KILL ${childs} 2>/dev/null
+ return 0
+ fi
+}
+
+reload() {
+ ebegin "Reloading ${description} configuration"
+ start-stop-daemon --stop --signal HUP --pidfile "${pidfile}"
+ eend ${?}
+}