java -cp ./ ViewServer
if you want to keep the logging information, then re-direct the
output into a file. For example:
java -cp ./ ViewServer >serve.txt 2&gs;i&1
Note: if you're using Java version 1.0 or 1.1, the java
command should be replaced by the jre command.
On our Unix machines, we usually do not run this as a daemon started by the system; rather, we have a crontab entry that checks every 15 minutes to see if the server is running -- if it is not, then it starts the server and sends an email message to someone. The crontab entry might look like:
0,15,30,45 * * * * /home/user/vview/makeserverrun >/home/user/vview/cout.txtwhich runs the makeserverrun script. Here's our version of makeserverrun:
#!/bin/ksh
cd /home/user # these two lines are there to set up the environment
. ./.profile # needed to run Java
umask 002 # make sure that created files have rw-rw-r-- permissions
ps -fu user >/home/user/vview/ps.txt
value=`grep ViewServer /home/user/vview/ps.txt`
stat=$?
# the first 4 lines of the if block are there only to send an email notice
if [ $stat -ne 0 ]; then
echo Subject: Restarted VISITview Server >/home/user/vview/mailmessage.txt
echo Precedence: bulk >>/home/user/vview/mailmessage.txt
echo The VISITview Server was restarted at `date` >>/home/user/vview/mailmessage.txt
cat /home/user/vview/mailmessage.txt |mail user@ssec.wisc.edu
/home/user/vview/doserver
fi
where the doserver script is:
#!/bin/ksh cd /home/user # again, just setting up the correct environment . .profile # for running umask 002 cd /home/user/vview nohup java ViewServer >server.txt 2>&1 &
Return to VISITview home page.