Autoboot SQL Server (DEC Unix)


The script presented here works fine when run by hand but will not start the server when the system is booted. The server is run as root so it shouldn't be a priv problem. If anyone has any ideas please email me at dr_thiede@pnl.gov

Adaptation of the script presented in Autoboot_of_SQL_Server for a DEC 3000/300 running DIGITAL UNIX 3.2c. There were a few typos and changes that were needed. Some comments were removed to improve readability ;) If you need them see the original.

Wouldn't it be nice if isql permitted a command line script like some of the standard unix utilities?


ln -s /sbin/init.d/sybase /sbin/rc3.d/S99sybase
ln -s /sbin/init.d/sybase /sbin/rc3.d/K99sybase

#!/bin/sh

USAGE="Usage: /sbin/init.d/sybase {start | stop}"

SYBASE=/sybase
DSQUERY=SERVER_NAME
PASSWD=*********
RUNSERVER=RUN_SERVER_NAME
OUTFILE=./out

if [ $# -lt 1 ]
then
        echo "$USAGE"
        exit 1
fi

export SYBASE

case $1 in
'start')
	echo start sybase
	nohup $SYBASE/install/startserver -f $SYBASE/install/$RUNSERVER >$OUTFILE&
	;;
'stop')
	echo stop sybase
$SYBASE/bin/isql -S$DSQUERY -Usa -P$PASSWD <<!
shutdown with nowait
go
!
	;;
*)
	echo $USAGE
	exit 1
	;;
esac

exit 0