From: Jacek Konieczny Date: Fri, 22 Aug 2008 13:20:36 +0000 (+0000) Subject: - new files, based on openser X-Git-Tag: auto/th/opensips-1_5_0-1~9 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fopensips.git;a=commitdiff_plain;h=97a0a1bc4b6ed36c74df4e454231688f1effbe3d - new files, based on openser Changed files: opensips.init -> 1.1 opensips.sysconfig -> 1.1 --- diff --git a/opensips.init b/opensips.init new file mode 100644 index 0000000..96aa2a3 --- /dev/null +++ b/opensips.init @@ -0,0 +1,70 @@ +#!/bin/sh +# +# opensips This shell script takes care of starting and stopping opensips +# +# chkconfig: 2345 20 80 +# description: opensips +# processname: opensips + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + msg_network_down opensips + exit 1 + fi +else + exit 0 +fi + +start() { + # Start daemons. + if [ ! -f /var/lock/subsys/opensips ]; then + msg_starting opensips + daemon opensips + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/opensips + else + msg_already_running opensips + fi +} + +stop() { + # Stop daemons. + if [ -f /var/lock/subsys/opensips ]; then + msg_stopping opensips + killproc opensips + rm -f /var/lock/subsys/opensips >/dev/null 2>&1 + else + msg_not_running opensips + fi +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + status) + status opensips + exit $? + ;; + *) + msg_usage "$0 {start|stop|restart|force-reload|status}" + exit 3 +esac + +exit $RETVAL diff --git a/opensips.sysconfig b/opensips.sysconfig new file mode 100644 index 0000000..a40048e --- /dev/null +++ b/opensips.sysconfig @@ -0,0 +1,2 @@ +# Define nice level for opensips +SERVICE_RUN_NICE_LEVEL="+5"