sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sks-devel] funny one in /etc/init.d/sks


From: teun Tilburg University
Subject: [Sks-devel] funny one in /etc/init.d/sks
Date: Sun, 22 Aug 2004 21:39:57 +0200

Hi,

hopefully minsky.surfnet.nl never crashes. But suppose it does....

Our Debian people beat me around the head if I don't have decent
scripts to start and stop sks at reboot. So I told them I really want

cd /var/sks
sks db &
sleep 2
sks recon &

and

killall sks
while [ "`pidof sks`" ]; do sleep 1; done # wait until SKS processes have exited

but they hate that for several good reasons like potentially
infinite shutdown times. They gave me the following:

address@hidden:~$ more /etc/init.d/sks
#! /bin/sh -e

DIR=/var/sks
SKS=/opt/sks/bin/sks
OPTS="-basedir $DIR"

test -x $SKS || exit 0
cd $DIR || exit $?

case "$1" in
        start)
                echo -n "Starting SKS:"
                echo -n \ sks-db
                start-stop-daemon --start --quiet --background --chuid sks 
--name sks-db --exec $SKS -- db $OPTS
                echo -n \ sks-recon
                start-stop-daemon --start --quiet --background --chuid sks 
--name sks-recon --exec $SKS -- recon $OPTS
                echo "."
        ;;
        stop)
                echo -n "Stopping SKS:"
                echo -n \ sks-recon
                start-stop-daemon --stop --quiet --retry 20 --name sks-recon 
--exec $SKS
                echo -n \ sks-db
                start-stop-daemon --stop --quiet --retry 20 --name sks-db 
--exec $SKS
                echo "."
        ;;
        *)
                echo "Usage: /etc/init.d/sks {start|stop}"
                exit 1
        ;;
esac

exit 0
address@hidden:~$ 

Of course the wizards have many reasons to love start-stop-daemon, but a thing
it does not have is a parameter that does the 'cd /var/sks'. That's why they use
the sks -basedir option in
OPTS="-basedir $DIR"

Now for the funny one: sks-db starts like a charm as does sks-recon,
but sks puts a *double* /var/sks/ in front of filenames as a consequence
of using '-basedir /var/sks'  I now have logfile entries like
  Adding list of 1 keys from file /var/sks//var/sks/messages/msg-93817016.ready

It all works after   mkdir /var/sks/dir   and
address@hidden:~$ ls -l /var/sks/var
total 0
lrwxrwxrwx    1 root     root            2 Aug 19 14:01 sks -> ..

but why the double?

cheers,

teun




reply via email to

[Prev in Thread] Current Thread [Next in Thread]