it is necessary to handle start and also stop of virtuos
a possible way:
(as user running virtuoso)
create bin folder in home of user that runs virtuoso and add following scripts
virtuosoStart.sh
DBDIR=/vol0/virtuosodb
VIRTUOSO_BIN=/opt/virtuoso7/bin/
export PATH=$VIRTUOSO_BIN:$PATH
cd $DBDIR
virtuoso-t
virtuosoStop.sh
#!/bin/bash
VIRTUOSO_BIN=/opt/virtuoso7/bin/
${VIRTUOSO_BIN}isql-v 1111 dba dba -K
please change DBDIR and VIRTUOSO_BIN according to you environment
(as root, "sudo su" or add sudo before every command )
Now is necessary to make script that accept start and stop parameter in folder /etc/init.d .
cp skeleton virtuoso
chmod a+x virtuoso
you can delet eunnecessary functions and implement start stop and status operation following way:
DESC="virtuoso server"
NAME=virtuoso
DAEMON=/opt/virtuoso7/bin/virtuoso-t
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
DBDIR=/vol0/virtuosodb
PIDFILE=${DBDIR}/virtuoso.lck
SCRIPTNAME=/etc/init.d/$NAME
USER=ubuntu
START_SCRIPT=/home/${USER}/bin/virtuosoStart.sh
STOP_SCRIPT=/home/${USER}/bin/virtuosoStop.sh
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
su -l $USER -c $START_SCRIPT
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
su -l $USER -c $STOP_SCRIPT
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
if [ -f $PIDFILE ] && ps -p$(cut -d "=" -f 2 ${PIDFILE} ) > /dev/null;then
log_success_msg "$NAME is running"
exit 0
else
log_failure_msg "$name is not running"
exit 1
fi
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status}" >&2
exit 3
;;
esac
now is necessay to add links to the script to appropriate /etc/rc.x folders. You can do it manually or better way is by :
update-rc.d virtuoso defaults
hope it helps and good luck
btw: you can add check if the virtuoso is already running to the start part of the init script