- Log into your computer as root.
- Put a new script into the rc3.d directory. On a Sun/Sparc system, this
is
/etc/rc3.d
; on a Linux system, this is usually
/etc/init.d/rc3.d
. Copy and paste the test below into
a new file in this directory called S89StorageServer.
N.B this script assumes that the Jim script
StorageServer
is installed in /usr/local/bin; edit
the script S89StorageServer if it is not.
#!/bin/sh
#
# Copyright (c) 2003-2006, Xinapse Systems Ltd.
#
if [ ! -d /usr/local/bin ]
then # /usr/local/bin not mounted
exit
fi
# Start/stop the Dicom Storage Server.
case "$1" in
'start')
#
# Start the dicom storage server
#
if [ -f /var/run/StorageServer.pid ] ; then
echo "StorageServer alreading running. Restart it with: $0 restart"
exit
fi
if [ -f /usr/local/bin/StorageServer ] ; then
echo "Starting StorageServer."
/usr/local/bin/StorageServer &
echo $! > /var/run/StorageServer.pid
# Wait for the server to come up.
sleep 4
fi
;;
'restart')
#
# Restart the dicom storage server
#
# Stop it first.
if [ -f /var/run/StorageServer.pid ] ; then
echo "Stopping StorageServer."
pkill -P `cat /var/run/StorageServer.pid` >/dev/null 2>&1
/bin/rm /var/run/StorageServer.pid
fi
# Restart it.
if [ -f /usr/local/bin/StorageServer ] ; then
echo "Starting StorageServer."
/usr/local/bin/StorageServer &
echo $! > /var/run/StorageServer.pid
# Wait for the server to come up.
sleep 4
fi
;;
'stop')
if [ -f /var/run/StorageServer.pid ] ; then
echo "Stopping Dicom StorageServer."
pkill -P `cat /var/run/StorageServer.pid` >/dev/null 2>&1
/bin/rm /var/run/StorageServer.pid
fi
;;
*)
echo "Usage: /etc/init.d/StorageServer { start | stop }"
;;
esac
exit 0
- Make sure that new script is executable by root.
- Start the script by hand to make sure that is correctly configured. On a
Sun/Solaris system, do:
# cd /etc/rc3.d; ./S89StorageServer start
On a Linux system, do:
# cd /etc/init.d/rc3.d; ./S89StorageServer start
- If all is well, reboot your system and check the StorageServer
daemon is running:
# ps -ef | grep StorageServer
root 5354 1 0 16:34:58 pts/2 0:00 /bin/csh /usr/local/bin/StorageServer
root 5357 5345 0 16:35:10 pts/2 0:00 grep StorageServer
- You're done. The StorageServer will start up automatically
every time your computer reboots. Note, however, that your
computer won't receive images from a remote DICOM server if it is
turned off!