# 2 if daemon could not be started
start-stop-daemon -b --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) )
# 2 if daemon could not be started
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) )
if [ "$1" == "start" ]
then
java -cp $JDBC_DRIVER:$GIGI_EXEC org.cacert.gigi.Launcher
+elif [ "$1" == "start-daemon" ]
+then
+ if [ ! -e /etc/cacert-gigi/conf.tar ]; then
+ echo "Config missing."
+ exit 1;
+ fi
+ java -cp $JDBC_DRIVER:$GIGI_EXEC org.cacert.gigi.Launcher < /etc/cacert-gigi/conf.tar >> /var/log/cacert-gigi.log 2>&1 &
+ echo $! > /var/run/cacert-gigi.pid
elif [ "$1" == "signer" ]
then
java -cp $JDBC_DRIVER:$GIGI_EXEC org.cacert.gigi.util.SimpleSigner