File bayonne2-opensuse.patch of Package bayonne2

Index: bayonne2-2.3.2/config/bayonne.init.in
===================================================================
--- bayonne2-2.3.2.orig/config/bayonne.init.in
+++ bayonne2-2.3.2/config/bayonne.init.in
@@ -15,6 +15,17 @@
 # chkconfig: 2345 98 10
 # description: Bayonne is the telephony server of the GNU  \
 # project and offers interactive voice response.   
+#
+# For LSB compatibility:
+#
+### BEGIN INIT INFO
+# Provides: bayonne
+# Required-Start: $remote_fs
+# Required-Stop:  $remote_fs
+# Default-Start:  3 5
+# Default-Stop:   0 1 2 6
+# Description:    Bayonne is the telephony server of the GNU project and offers interactive voice response.
+### END INIT INFO
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON="@config_sbindir@/bayonne"
@@ -33,6 +44,7 @@ test -x $DAEMON || exit 0
 DAEMON_OPTS="-p"
 
 set -e
+. /etc/rc.status
 
 if test -f /etc/sysconfig/bayonne ; then
         source /etc/sysconfig/bayonne
@@ -70,7 +82,9 @@ case "$1" in
 
 	DAEMON_PRELOAD=""
 	if test -f /usr/dialogic/lib/libgc.so ; then
-		DAEMON_PRELOAD=/usr/lib/libLiS.so:/usr/dialogic/lib/libgc.so:/usr/dialogic/lib/libdevmap.so 
+		DAEMON_PRELOAD=/usr/lib64/libLiS.so:/usr/lib/libLiS.so:/usr/dialogic/lib/libgc.so:/usr/dialogic/lib/libdevmap.so 
+	elif test -f /usr/lib64/libLiS.so ; then
+		DAEMON_PRELOAD=/usr/lib64/libLiS.so
 	elif test -f /usr/lib/libLiS.so ; then
 		DAEMON_PRELOAD=/usr/lib/libLiS.so
 	fi
@@ -87,49 +101,101 @@ case "$1" in
 		export LD_PRELOAD
 	fi
 
-	if test -p $FIFO ; then
-		echo "already started"
-		exit -1
-	fi
-
-
 	if test ! -z "$OPTIONS" ; then
 		DAEMON_OPTS="$OPTIONS" ; fi
 
-	$DAEMON $DAEMON_OPTS
-	echo "$NAME."
+	startproc $DAEMON $DAEMON_OPTS
+	RETVAL=$?
+ 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bayonne
+	echo
+
+	# Remember status and be verbose
+	rc_status -v
 	;;
   stop)
-	if test ! -p $FIFO ; then 
-		exit 0 ; fi
+	echo -n "Shutting down service bayonne: "
+	## Stop daemon with killproc(8) and if this fails
+	## set echo the echo return value.
+
+	killproc -TERM $bayonne_BIN
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bayonne
 
-	echo -n "Stopping $DESC: "
-	echo "down" >$FIFO
-	echo "$NAME."
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    restart)
+	## Stop the service and regardless of whether it was
+	## running or not, start it again.
+	$0 stop
+	$0 start
+
+	# Remember status and be quiet
+	rc_status
+	;;
+    force-reload)
+	## Signal the daemon to reload its config. Most daemons
+	## do this on signal 1 (SIGHUP).
+	## If it does not support it, restart.
+
+	echo -n "Reload service bayonne"
+	## if it supports it:
+	killproc -HUP $bayonne_BIN
+	#touch /var/run/bayonne.pid
+	rc_status -v
+
+	## Otherwise:
+	#$0 stop  &&  $0 start
+	#rc_status
 	;;
   reload)
-	if test ! -p $FIFO ; then
-		exit 0 ; fi
-	echo -n "Reloading $DESC: "
-	echo "reload" >$FIFO
-	echo "$NAME."
-	;;
-  restart|force-reload)
-	#
-	#	If the "reload" option is implemented, move the "force-reload"
-	#	option to the "reload" entry above. If not, "force-reload" is
-	#	just the same as "restart".
-	#
-	echo -n "Restarting $DESC: "
-	start-stop-daemon --stop --quiet --exec $DAEMON
-	sleep 3
-	start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS
-	echo "$NAME."
+	## Like force-reload, but if daemon does not support
+	## signalling, do nothing (!)
+
+	# If it supports signalling:
+	echo -n "Reload service bayonne"
+	killproc -HUP $bayonne_BIN
+	#touch /var/run/bayonne.pid
+	rc_status -v
+	
+	## Otherwise if it does not support reload:
+	#rc_failed 3
+	#rc_status -v
+	;;
+  try-restart)
+	## Stop the service and if this succeeds (i.e. the 
+	## service was running before), start it again.
+	## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
+	$0 status >/dev/null &&  $0 restart
+
+	# Remember status and be quiet
+	rc_status
+	;;
+    status)
+	echo -n "Checking for bayonne: "
+	## Check status with checkproc(8), if process is running
+	## checkproc will return with exit status 0.
+
+	# Status has a slightly different for the status command:
+	# 0 - service running
+	# 1 - service dead, but /var/run/  pid  file exists
+	# 2 - service dead, but /var/lock/ lock file exists
+	# 3 - service not running
+
+	# NOTE: checkproc returns LSB compliant status values.
+	checkproc $bayonne_BIN
+	rc_status -v
+	;;
+    probe)
+	## Optional: Probe for the necessity of a reload,
+	## give out the argument which is required for a reload.
+
+	test /etc/bayonne.conf -nt /var/run/bayonne.pid && echo reload
 	;;
   *)
 	N=/etc/init.d/$NAME
 	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
-	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
 	exit 1
 	;;
 esac
Index: bayonne2-2.3.2/server/Makefile.am
===================================================================
--- bayonne2-2.3.2.orig/server/Makefile.am
+++ bayonne2-2.3.2/server/Makefile.am
@@ -14,7 +14,6 @@ EXTRA_DIST=bayonne.1 *.bat
 INCLUDES = -I$(top_srcdir)/engine
 
 noinst_HEADERS = server.h
-man1_MANS = bayonne.1
 man_MANS = bayonne.1
 
 bayonnedir=@module_libdir@
openSUSE Build Service is sponsored by