[opensips] Updated init-script

Peter Lemenkov peter at fedoraproject.org
Mon Jul 11 13:52:14 UTC 2011


commit aaa6bfac9236127f50e004a91748d91894cc0a82
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Mon Jul 11 17:51:54 2011 +0400

    Updated init-script
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 ...ps-0001-Check-for-stale-nonce-in-pre_auth.patch |    2 +-
 ...overlapping-both-auth-realm-and-auth-resp.patch |    2 +-
 opensips-0003-Fixed-init-script.patch              |   99 ++++++++++++++++++++
 opensips.spec                                      |    7 +-
 4 files changed, 107 insertions(+), 3 deletions(-)
---
diff --git a/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch b/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
index f2f185b..9f66368 100644
--- a/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
+++ b/opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
@@ -1,7 +1,7 @@
 From 5ce7165bfb2869300258193fdabbdf442435362b Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Mon, 6 Dec 2010 15:56:54 +0300
-Subject: [PATCH 1/2] Check for stale nonce in pre_auth
+Subject: [PATCH 1/3] Check for stale nonce in pre_auth
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
 ---
diff --git a/opensips-0002-fixed-pvar-overlapping-both-auth-realm-and-auth-resp.patch b/opensips-0002-fixed-pvar-overlapping-both-auth-realm-and-auth-resp.patch
index 3ac6a08..ba17c2f 100644
--- a/opensips-0002-fixed-pvar-overlapping-both-auth-realm-and-auth-resp.patch
+++ b/opensips-0002-fixed-pvar-overlapping-both-auth-realm-and-auth-resp.patch
@@ -1,7 +1,7 @@
 From faaaacc7d9ad641e3d18b670703e2ca8108c9cda Mon Sep 17 00:00:00 2001
 From: bogdan_iancu <bogdan_iancu at 689a6050-402a-0410-94f2-e92a70836424>
 Date: Fri, 28 Jan 2011 10:17:40 +0000
-Subject: [PATCH 2/2] - fixed pvar overlapping - both auth realm and auth
+Subject: [PATCH 2/3] - fixed pvar overlapping - both auth realm and auth
  response were defined as $ar. auth response moved as
  $auth.resp  Credits for report go to medve on IRC
  channel
diff --git a/opensips-0003-Fixed-init-script.patch b/opensips-0003-Fixed-init-script.patch
new file mode 100644
index 0000000..b412fd3
--- /dev/null
+++ b/opensips-0003-Fixed-init-script.patch
@@ -0,0 +1,99 @@
+From e4356713348159a9d4c8a30884c1852dc2edea4d Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Mon, 11 Jul 2011 16:24:51 +0400
+Subject: [PATCH 3/3] Fixed init-script
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ packaging/fedora/opensips.init |   39 ++++++++++++++++++++++++++++++---------
+ 1 files changed, 30 insertions(+), 9 deletions(-)
+
+diff --git a/packaging/fedora/opensips.init b/packaging/fedora/opensips.init
+index 40adb88..685d1ef 100644
+--- a/packaging/fedora/opensips.init
++++ b/packaging/fedora/opensips.init
+@@ -20,28 +20,49 @@
+ # Source function library.
+ . /etc/rc.d/init.d/functions
+ 
+-oser=/usr/sbin/opensips
+ prog=opensips
++oser=/usr/sbin/$prog
++pidfile="/var/run/$prog.pid"
++lockfile="/var/lock/subsys/$prog"
++configfile="/etc/$prog/$prog.cfg"
++OPTIONS=""
++
+ RETVAL=0
+ 
+ [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+ 
+ start() {
+ 	echo -n $"Starting $prog: "
++
++	# check whether OpenSIPs was already started
++	if status $prog > /dev/null 2>&1 ; then
++		echo -n "already running" && warning && echo
++		return 0
++	fi
++
+ 	# there is something at end of this output which is needed to
+ 	# report proper [ OK ] status in Fedora scripts
+-	daemon $oser $OPTIONS 2>/dev/null | tail -1
++	daemon $oser -P $pidfile -f $configfile $OPTIONS 2>/dev/null | tail -1
+ 	RETVAL=$?
+ 	echo
+-	[ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
++	[ $RETVAL = 0 ] && touch $lockfile
++	return $RETVAL
+ }
+ 
+ stop() {
+ 	echo -n $"Stopping $prog: "
+-	killproc $oser
++
++	# check whether OpenSIPs is running
++	if ! status $prog > /dev/null 2>&1 ; then
++		echo -n "not running" && warning && echo
++		return 0
++	fi
++
++	killproc $prog 2> /dev/null
+ 	RETVAL=$?
+ 	echo
+-	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
++	[ $RETVAL = 0 ] && rm -f $lockfile $pidfile
++	return $RETVAL
+ }
+ 
+ # See how we were called.
+@@ -53,22 +74,22 @@ case "$1" in
+ 		stop
+ 		;;
+ 	status)
+-		status $oser
++		status $prog
+ 		RETVAL=$?
+ 		;;
+ 	restart|reload)
+ 		stop
+ 		start
+ 		;;
+-	condrestart)
+-		if [ -f /var/run/opensips.pid ] ; then
++	condrestart|try-restart)
++		if [ -f $pidfile ] ; then
+ 			stop
+ 			start
+ 		fi
+ 		;;
+ 	*)
+ 		echo $"Usage: $prog {start|stop|reload|restart|condrestart|status|help}"
+-		exit 1
++		RETVAL=2
+ esac
+ 
+ exit $RETVAL
+-- 
+1.7.6
+
diff --git a/opensips.spec b/opensips.spec
index 3c9872f..1c79031 100644
--- a/opensips.spec
+++ b/opensips.spec
@@ -10,13 +10,14 @@
 Summary:  Open Source SIP Server
 Name:     opensips
 Version:  1.6.4
-Release:  8%{?dist}
+Release:  9%{?dist}
 License:  GPLv2+
 Group:    System Environment/Daemons
 Source0:  http://opensips.org/pub/%{name}/%{version}/src/%{name}-%{version}-2-tls_src.tar.gz
 Source1:  %{name}.sysconfig
 Patch1:   opensips-0001-Check-for-stale-nonce-in-pre_auth.patch
 Patch2:   opensips-0002-fixed-pvar-overlapping-both-auth-realm-and-auth-resp.patch
+Patch3:   opensips-0003-Fixed-init-script.patch
 URL:      http://opensips.org
 
 BuildRequires:  expat-devel
@@ -519,6 +520,7 @@ clients.
 %setup -q -n %{name}-%{version}-2-tls
 %patch1 -p1 -b .nonce
 %patch2 -p1 -b .rename
+%patch3 -p1 -b .init
 
 %build
 LOCALBASE=/usr CFLAGS="%{optflags}" %{__make} all %{?_smp_mflags} TLS=1 \
@@ -1010,6 +1012,9 @@ fi
 %doc docdir/README.xmpp
 
 %changelog
+* Mon Jul 11 2011 Peter Lemenkov <lemenkov at gmail.com> - 1.6.4-9
+- Updated init-script
+
 * Mon Jul 11 2011 Peter Lemenkov <lemenkov at gmail.com> - 1.6.4-8
 - Upstream re-released traball with several new patches (API compatible)
 


More information about the scm-commits mailing list