Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
Unix Service problem
Oscar
2008-07-06 13:37:14
Hi, I follow all instructions in order to run server as Unix daemon. I'm working with SCO Openserver 5.0.7.

When I execute : "# cat /etc/inittab | grep :initdefault"

I receive :"is:S:initdefault:"

then, in number "5.cd /etc/rcx.d", in /etc I only can see this directories :
.....
.....
rbldsh
rc
rc.d
rc0
rc0.d
rc1
rc2
rc2.d
rc3
rdate
rdistd
....
....

I try change to rc2.d, in this directory I've :

# cd rc2.d
# ls
I01MOUNTFSYS
P00SYSINIT
P03RECOVERY
P04CLEAN
P05RMTMPFILES
P15HWDNLOAD
P16KERNINIT
P20sysetup
P21perf
P70uucp
P75cron
P86mmdf
P86scologin
P86xdlls
P87USRDAEMON
P88USRDEFINE
P90RESERVED
P90apache
P95calserver
S00MDAC
S25pm
S35dlpi
S60sync
S80lp
S81giomap
S84rpcinit
S85nis
S85tcp
S86netbios
S89lmc
S89nfs
S90atlas
S90iproute
S90secure
S91manahttp
S95docview
S99apcssd
S99man
messages
#


My questions : Does my Unix version can run HXTT as daemon ???...

If I run manually, HXTT work fine (graphic mode), I can too run as :

java -classpath DBF_JDBC30.jar com.hxtt.sql.admin.HxttService...and work fine,
but I need to compulsorily run as Daemon, without user operation....

Thanks in advance,

Re:Unix Service problem
HXTT Support
2008-07-06 19:13:11
That comman is just to know the default run level of your machine. You can skip an go on other operation.
3.run the follows command to know the default run level of your machine.
cat /etc/inittab | grep :initdefault
it's result will be as follows: id:3:initdefault
or
runlevel
it's result will be as follows:N 3
In common,the default run level should be 3 or 5.

>java -classpath DBF_JDBC30.jar com.hxtt.sql.admin.HxttService...and work fine,
>but I need to compulsorily run as Daemon, without user operation....
You can use Admin's remote control feature to control that Daemon.
Re:Re:Unix Service problem
HXTT Support
2008-07-06 19:21:13
You can try
runlevel
it's result will be as follows:N 3
Re:Re:Re:Unix Service problem
Oscar San Martin
2008-07-07 20:12:06
Ok, but my question is :

"cat /etc/inittab | grep :initdefault"
result is = "is:S:initdefault:" , not "id:3:initdefault"...

...what mean this???, SCO 5.0.7 is snot supported ???

Thanks,
Re:Re:Re:Re:Unix Service problem
HXTT Support
2008-07-07 20:38:59
>...what mean this???, SCO 5.0.7 is snot supported ???
Don't worry. The inittab entry sets the default run level for the system to single-user mode. You can continue your test.
Re:Re:Re:Re:Re:Unix Service problem
Oscar San Martin
2008-07-13 15:57:41
Ok, I was continue with instructions, but when I start service, I can see :

...
...
# sh hxttjsvcserv start
hxttjsvcserv: 745 Killed
#
...
...

Always service is inmmediately killed....

I tried too with this script (real values) :

#!/bin/sh
#
# Start JSVC SERVICE
#
/commondaemon/jsvc \
-user root \
-home /opt/java2-1.4.2 \
-Djava.io.tmpdir=/tmp \
-Dhxtt.urlconfig=//urlconfig.properties \
-Dhxtt.daemonport=2711 \
-Dhxtt.daemonpassword=koke \
-wait 10 \
-pidfile 100 \
-outfile /tmp/jsvc.log \
-errfile /tmp/jsvc.err \
-cp /opt/java2-1.4.2/lib/tools.jar:/commondaemonE/commons-daemon.jar:/u/javas/DBF_JDBC30.jar \
com.hxtt.sql.admin.HxttDaemon

....
....

And is killed too...

I can't see any log file....

Thanks...

Re:Re:Re:Re:Re:Re:Unix Service problem
HXTT Support
2008-07-14 00:38:11
Checked. For SCO OpenServer, startup using jsvc is not implemented. You can also run directly com.hxtt.sql.admin.HxttService with

above same parameters.
Re:Re:Re:Re:Re:Re:Re:Unix Service problem
Oscar San Martin
2008-07-14 09:22:34
Yes, I tried and work fine, but I need be logged in OpenServer with user...., if I try run when machine startup (without login) in :

".profile" or "rc" : Don't work....

Thanks,

Oscar
Re:Re:Re:Re:Re:Re:Re:Re:Unix Service problem
HXTT Support
2008-07-14 10:00:47
You can change the start command in hxttjsvcserv to start that server.
For instance,
$JAVA_HOME/bin/java \
-Djava.awt.headless=true \
-Djava.io.tmpdir=$TMP_DIR \
-Dhxtt.urlconfig=$URLCONFIGPATH \
-Dhxtt.daemonport=$DAEMONPORT \
-Dhxtt.daemonpassword=$DAEMONPASSWORD \
-cp $CLASSPATH \
com.hxtt.sql.admin.HxttService

Re:Re:Re:Re:Re:Re:Re:Re:Unix Service problem
Oscar San Martin
2008-07-14 11:44:11
Ok,

¿SERV_USER and DAEMONPASSWORD must be UNIX user ???? I use root and his password...is this correct??

Thanks,
Re:Re:Re:Re:Re:Re:Re:Re:Unix Service problem
HXTT Support
2008-07-14 17:51:16
>SERV_USER and DAEMONPASSWORD must be UNIX user
You needn't. DAEMONPASSWORD is just for remote control that server.
Re:Re:Re:Re:Re:Re:Re:Re:Unix Service problem
Oscar San Martin
2008-07-16 11:32:51
Ok, I tried this script and work fine...but, if I put on RC file in order to run when machine startup....script run and console show HXTT Service running...but if I try open other terminal and try shutdown machine, not work....

Where can I put srcript execution in order tu run automatically when machine startup?

I was thinking in .profile, but this requieres user login...

Thanks in advance...
Re:Re:Re:Re:Re:Re:Re:Re:Unix Service problem
HXTT Support
2008-07-16 17:27:20
>but if I try open other terminal and try shutdown machine, not work....
I guess that you should kill it through pid.

>Where can I put srcript execution in order tu run automatically
>when machine startup?
Run thah script as an init.d . You can read how to run tomcat on SCO.

#!/bin/sh
#
# %Z% %M% %I% %E% %Q%
#
# Copyright (c) 2004 The Santa Cruz Operation, Inc.. All Rights Reserved.
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE SANTA CRUZ OPERATION INC.
# The copyright notice above does not evidence any actual or intended
# publication of such source code.
#
# Written 07-Jan-2004 by Ronald Joe Record
#
# tomcat start/stop script
# Usage: tomcat [ start | stop | enable | disable | restart | status ]
#
set -a
JSVC=
# Startup using jsvc not implemented on OpenServer
#JSVC=jsvc_
TOMCAT_HOME="/usr/lib/apache/tomcat"
TOMCAT_BIN="$TOMCAT_HOME/bin"
JAVA_HOME=/usr/java
CATALINA_HOME=/usr/lib/apache/tomcat
CATALINA_LOG=$CATALINA_HOME/logs/catalina.out
TOMCAT_USER=root
PID_DIR=/var/run
PIDFILE=$PID_DIR/jsvc.pid

[ -f /etc/default/tomcat ] && {
. /etc/default/tomcat
}

# definitions
USAGE="Usage: %s [ start | stop | enable | disable | restart | status ]"
LABEL="UX:`basename $0`"
CAT="tomcat.cat"

# paths to tomcat files, and a label
TOMCAT_LABEL="tomcat"

OS=`uname -v`
case $OS in
7.1.*)
TOMCAT_START="$TOMCAT_BIN/startup.sh"
TOMCAT_STOP="$TOMCAT_BIN/shutdown.sh"
;;
6.0.*|5.0.*)
TOMCAT_USER=root
TOMCAT_START="nohup /bin/su -S -s /bin/sh -c $TOMCAT_HOME/bin/startup.sh"
TOMCAT_STOP="/bin/su -S -s /bin/sh -c $TOMCAT_HOME/bin/shutdown.sh"

;;
esac

# Work around for stopping tomcat by killing it ..
TOMCAT_PID_FILE=$PID_DIR/kill.$TOMCAT_LABEL.pid

# PS_STR is used to determine the tomcat PID
PS_STR="java.endorsed.dirs=.*/.*tomcat"


# more paths, and some wait timeouts
PATH="/bin:/usr/bin:/etc:/usr/gnu/bin"; export PATH
SCRIPTDIR="/etc/init.d"
SCRIPT="tomcat"
SCRIPTNUM="95"

#######################################################################
### get tomcat process PID
### return 0 if process is not running
#######################################################################
get_tomcat_pid() {
# Do NOT change cut -d" " -f2 to extract tomcat PID
# read OWNER PID JUNK does not work on a UW714 system.

PID=`ps -aef | \
grep "${PS_STR}" | \
grep -v "grep ${PS_STR}" | \
sed "s~ *~ ~g" | sed "s~^ ~~" | \
cut -d" " -f2`

echo "${PID}" >${TOMCAT_PID_FILE}
}

reset_owner() {
chown -R nouser $TOMCAT_HOME/logs $TOMCAT_HOME/work \
$TOMCAT_HOME/temp $TOMCAT_HOME/conf \
$TOMCAT_HOME/webapps/ROOT 2>&1 > /dev/null
chown nouser $TOMCAT_HOME/server/webapps $TOMCAT_HOME/webapps
}

#############################################################################
#
# tomcat_start
#
# start the server daemon running
#
#############################################################################
tomcat_start() {

# start the server
# reset_owner

get_tomcat_pid
PID=`cat ${TOMCAT_PID_FILE}`
if [ -n "$PID" ] ; then
dspmsg $CAT 3 \
"%s is already running ...\n" $TOMCAT_LABEL
return 0
else
dspmsg $CAT 3 \
"%s is not running. Starting %s ... " $TOMCAT_LABEL
fi

nohup $TOMCAT_START >> ${CATALINA_LOG} 2>&1
RC=$?
if [ $RC -eq 0 ] ; then
dspmsg $CAT 4 "done.\n"
# reset_owner
else

# execution of the server binary failed in some way
echo ""
dspmsg $CAT 6 \
"%s could not be started\n" $TOMCAT_LABEL
# reset_owner
fi
return $RC
}


#############################################################################
#
# tomcat_stop
#
# stop the server daemon if it is running
#
#############################################################################
tomcat_stop() {

# signal the server to stop
dspmsg $CAT 8 \
"Stopping %s ... " $TOMCAT_LABEL
# First check whether tomcat is running or not ..
get_tomcat_pid
PID=`cat ${TOMCAT_PID_FILE}`
if [ -z "$PID" ] ; then
dspmsg $CAT 8 \
"%s is not running .." $TOMCAT_LABEL
RC=0
else
nohup $TOMCAT_STOP >> ${CATALINA_LOG} 2>&1
RC=$?
if [ $RC -eq 0 ] ; then
# server is no longer running
dspmsg $CAT 9 "done.\n"
else
dspmsg $CAT 9 \
"%s could not be stopped. Killing $PID\n" $TOMCAT_LABEL
kill -9 ${PID}
RC=$?
get_tomcat_pid
PID1=`cat ${TOMCAT_PID_FILE}`
if [ -z "$PID1" ] ; then
dspmsg $CAT 9 "done.\n"
else
dspmsg $CAT 9 \
"$PID could not be killed.\n" $TOMCAT_LABEL
fi
fi
fi
return $RC
}

#############################################################################
#
# jsvc_tomcat_stop
#
# Stop Tomcat using jsvc
#
#############################################################################
jsvc_tomcat_stop() {

if [ -f $PIDFILE ]
then
dspmsg $CAT 8 \
"Stopping %s ... " $TOMCAT_LABEL
PID=`cat $PIDFILE`
kill $PID
dspmsg $CAT 9 "done.\n"
else
tomcat_stop
fi

return 0
}

#############################################################################
#
# jsvc_tomcat_start
#
# Start Tomcat using jsvc
#
#############################################################################
jsvc_tomcat_start() {

CLASSPATH=$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/bin/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar
TMP_DIR=/tmp

# reset_owner
dspmsg $CAT 3 \
"Starting %s ... " $TOMCAT_LABEL
[ -d $PID_DIR ] || mkdir -p $PID_DIR
$CATALINA_HOME/bin/jsvc \
-user $TOMCAT_USER \
-home $JAVA_HOME \
-pidfile $PIDFILE \
-Dcatalina.home=$CATALINA_HOME \
-Djava.io.tmpdir=$TMP_DIR \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile '&1' \
-cp $CLASSPATH \
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-verbose \
# To get a debug of jsvc.
#-debug \
dspmsg $CAT 4 "done.\n"
# reset_owner
return 0
}

#############################################################################
#
# tomcat_restart
#
# restart the server daemon by sending it a SIGHUP
#
#############################################################################
tomcat_restart() {

dspmsg $CAT 21 "Restarting .." $TOMCAT_LABEL
tomcat_stop
RC=$?
if [ $? -eq 0 ] ; then
tomcat_start
RC=$?
else
dspmsg $CAT 21 " tomcat could not be stopped .." $TOMCAT_LABEL
fi
return $RC
}

#############################################################################
#
# tomcat_status
#
# status of the service
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
#
#############################################################################
tomcat_status() {
get_tomcat_pid
PID=`cat ${TOMCAT_PID_FILE}`
if [ -n "$PID" ] ; then
dspmsg $CAT 6 "%s is running\n" $TOMCAT_LABEL
RC=0
else
dspmsg $CAT 6 "%s is not running\n" $TOMCAT_LABEL
#exit 3
RC=3
fi
return $RC
}

#############################################################################
#
# tomcat_enable
#
# add a link to this script into the /etc/rc2.d directory, then start
# the server
#
#############################################################################
tomcat_enable() {

# Link in /etc/init.d/tomcat to /etc/rc[02].d/[SP] startup links.
# Remove any pre-existing link.
# Otherwise the hard link get out of sync, if /etc/init.d/tomcat
# inode is changed.

ENABLE_STR=Enabling
if [ -f /etc/rc*.d/[PS]$SCRIPTNUM$SCRIPT ]; then
# one or more links already exists
test -z "$ISL" && dspmsg $CAT 15 \
"%s is already enabled.\n" $TOMCAT_LABEL
ENABLE_STR="Re-freshing the links"
fi

test -z "$ISL" && dspmsg $CAT 16 \
"$ENABLE_STR %s ... " $TOMCAT_LABEL

# Create S$SCRIPTNUM$SCRIPT. UW714 /etc/rc2 script
# starts the "S" scripts on boot
for FL in /etc/rc2.d/K /etc/rc2.d/S /etc/rc2.d/P \
/etc/rc0.d/P
do
rm -f $FL$SCRIPTNUM$SCRIPT
ln $SCRIPTDIR/$SCRIPT $FL$SCRIPTNUM$SCRIPT
done
test -z "$ISL" && dspmsg $CAT 17 "done.\n"

# start the server
test -z "$ISL" && tomcat_start
return $?

}


#############################################################################
#
# tomcat_disable
#
# stop the server, then remove any links to this script in /etc/rc*.d
#
#############################################################################
tomcat_disable() {

# stop the server
tomcat_stop
RC=$?

if [ -f /etc/rc*.d/[PS]$SCRIPTNUM$SCRIPT ] ; then
test -z "$ISL" && dspmsg $CAT 18 \
"Disabling %s ... " $TOMCAT_LABEL

# remove the /etc/rc*.d startup link
for FL in /etc/rc2.d/K /etc/rc2.d/S /etc/rc2.d/P \
/etc/rc0.d/P
do
rm -f $FL$SCRIPTNUM$SCRIPT
done
test -z "$ISL" && dspmsg $CAT 19 "done.\n"
else
# file does not exist
test -z "$ISL" && dspmsg $CAT 20 \
"%s is already disabled.\n" $TOMCAT_LABEL
fi
return $RC
}

#############################################################################
# main()
#############################################################################

# check the usage of the script
if [ $# -gt 1 ]; then
dspmsg $CAT 1 "$USAGE\n" `basename $0`
exit 1
fi

# function to perform is in $1
function="$1"

# execute the routine for the requested function
case $function in
start)
${JSVC}tomcat_start
RC=$?
;;
stop)
${JSVC}tomcat_stop
RC=$?
;;
enable)
tomcat_enable
RC=$?
;;
disable)
tomcat_disable
RC=$?
;;
restart)
tomcat_restart
RC=$?
;;
status)
tomcat_status
RC=$?
;;
*)
dspmsg $CAT 1 "$USAGE\n" `basename $0`
exit 1 ;;
esac

# done
exit $RC



Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap