Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > media > contrib-testing-src > by-pkgid > e605391193ef666accca8664470cb8ab > files > 7

firebird-2.1.4.18393.0-2mdv2010.2.src.rpm

--- builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in	2009-07-24 12:16:22.000000000 +0200
+++ builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in.new	2009-07-28 01:08:16.000000000 +0200
@@ -1,11 +1,20 @@
 #!/bin/sh
 
-# chkconfig: 345 20 80
+# chkconfig: 345 80 20
 # description: Start/Stop firebird database server
 #
 # This file belongs in /etc/init.d where it will be run
 # on system startup and shutdown to start the background
 # Firebird database server daemon 
+### BEGIN INIT INFO
+# Provides: firebird
+# Required-Start: $local_fs $syslog
+# Required-Stop:
+# Default-Start: 3 4 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Firebird server database
+# Description: Starts and stops the Firebird database server backend daemon.
+### END INIT INFO
 
 # Source function library - RedHat or Mandriva specific
 # functions actually used: checkpid killproc daemon
@@ -21,7 +30,7 @@
 FIREBIRD=@prefix@
 
 # No changes needed below for multiple instances
-name=firebird_$INSTANCE
+name=$(basename `readlink -f $0`)
 FBRunUser=firebird
 pidfile=/var/run/firebird/$INSTANCE.pid
 FULLNAME="Firebird server [$INSTANCE]"
@@ -37,7 +46,7 @@
 # See how we were called.
 case "$1" in
   start)
-	echo -n "Starting $FULLNAME "
+	gprintf "Starting %s " "$FULLNAME"
 	daemon --user=$FBRunUser "export FIREBIRD LD_LIBRARY_PATH; $MANAGER -pidfile $pidfile -start -forever"
 	RETVAL=$?
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
@@ -46,12 +55,12 @@
   stop)
 	if [ -f $pidfile ]
 	then
-		echo -n "Stopping $FULLNAME: "
+		gprintf "Stopping %s: " "$FULLNAME"
 		killproc -p $pidfile $name
 		RETVAL=$?
 		echo
 	else
-		echo -n "$FULLNAME is stopped"
+		gprintf "%s is stopped" "$FULLNAME"
 		echo
 	fi
 	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name      
@@ -62,9 +71,9 @@
 		pid=`cat $pidfile`
 		checkpid $pid
 		RETVAL=$?
-		[ $RETVAL -eq 0 ] && echo "$FULLNAME is running (pid $pid)" || echo "$FULLNAME is dead but pid file exists"
+		[ $RETVAL -eq 0 ] && gprintf "%s is running (pid %s)\n" "$FULLNAME" "$pid" || gprintf "%s is dead but pid file exists\n" "$FULLNAME"
 	else
-		echo "$FULLNAME is stopped"
+		gprintf "%s is stopped" "$FULLNAME"
 	fi
 	;;
   restart|reload)
@@ -74,7 +83,7 @@
 	RETVAL=$?
 	;;
   *)
-	echo "Usage: $0 {start|stop|status|restart|reload}"
+	gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$name"
 	exit 1
 esac