]> WPIA git - gigi.git/blobdiff - debian/cacert-gigi-testing.cacert-gigi.init
upd: postgresql adding debian dpendencies
[gigi.git] / debian / cacert-gigi-testing.cacert-gigi.init
index 46235d439c1f64b87db2b46a39983968ca4858d1..d22dbbfaf571277f69091e575914eacf44eebc11 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/sh
 ### BEGIN INIT INFO
 # Provides:          cacert-gigi
-# Required-Start:    $local_fs $network $remote_fs $syslog mysql
-# Required-Stop:     $local_fs $network $remote_fs $syslog mysql
+# Required-Start:    $local_fs $network $remote_fs $syslog postgresql
+# Required-Stop:     $local_fs $network $remote_fs $syslog postgresql
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: <Enter a short description of the software>
@@ -20,16 +20,21 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="cacert-gigi"
 NAME=cacert-gigi
 DAEMON=`which java`
-DAEMON_ARGS="-cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/gigi.jar org.cacert.gigi.Launcher"
+DAEMON_ARGS="-cp /usr/share/java/postgresql-jdbc4.jar:/usr/share/java/gigi.jar org.cacert.gigi.Launcher"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 DIR=/var/lib/cacert-gigi
 
 # Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
+[ -r "/usr/share/java/gigi.jar" ] || exit 0
 
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
+if [ "$START_DAEMON" = "0" ]; then
+    echo "Not starting $NAME (as configured in /etc/default/$NAME)";
+    exit 0;
+fi
+
 
 # Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh
@@ -44,18 +49,17 @@ DIR=/var/lib/cacert-gigi
 #
 do_start()
 {
-       if [ ! -f /etc/cacert-gigi/conf.tar ]; then
+       if [ ! -f /etc/cacert/gigi/conf.tar ]; then
                echo Missing gigi-configfile
-                exit 2
-        fi
+               exit 2
+       fi
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
-        start-stop-daemon -b --start --quiet --pidfile $PIDFILE -d $DIR --exec $DAEMON --test > /dev/null \
+       start-stop-daemon --start --quiet --pidfile $PIDFILE -d $DIR --exec $DAEMON --test > /dev/null \
                || return 1
-       start-stop-daemon -b --start --quiet --pidfile $PIDFILE --make-pidfile -d $DIR --exec $DAEMON --no-close -- \
-               $DAEMON_ARGS < /etc/cacert-gigi/conf.tar >> /var/log/cacert-gigi.log 2>&1 \
+       start-stop-daemon -b --start --quiet --pidfile $PIDFILE -d $DIR --exec /usr/bin/gigi -- start-daemon \
                || return 2
        # The above code will not work for interpreted scripts, use the next
        # six lines below instead (Ref: #643337, start-stop-daemon(8) )