--

Morten,

"echo $! > $PIDFILE"

would be your friend :-)
In case you want to use this pid for the purpse of killing jserv: The better way
of stopping jserv would be to send it a special signal (-s).  That way future
versions of jserv will have the chance to swap out session-objects to disk.

I created a similar script a while ago which does a little more than yours:

It also can start multiple virtual machines, each with it's own settings, logs
stdout and stderr into separate files and adds jar-files from vm-specific subdirs
automatically to the classpath before it starts the virtual machine.


I have found it very useful on our server. Together with a watchdog-application
that makes sure jserv is always running, and a cgi-script that lets you restart
the JServ-Servers via a web-page you'll get a nice JServ environment.

Let me know if you want the scripts.

Willi


Morten Primdahl wrote:

> --
>
> Hi
>
> I just installed JServ 1.0 and want to make a jserv.init for it.
> Basically I used what was in the init file for JServ 0.9.12, I
> just need to find the PID and echo it into a file. Any suggestions?
> The init file (so far) is below
>
> Thanks
>
> Morten
>
> JSERV_HOME=/usr/local/jserv
> APACHE_HOME=/usr/local/apache
> JAVA_HOME=/opt/jdk1.2
> JAVA_BINARY=${JAVA_HOME}/bin/java
>
> CLASSPATH=/opt/classes:/opt/classes/jsdk.jar:${JSERV_HOME}/lib/ApacheJServ.jar
>
> JSERV_PROPERTY_FILE=${JSERV_HOME}/conf/jserv.properties
> #This is what I need...
> #JSERV_LOCK_FILE=${JSERV_HOME}/logs/jserv.pid
> JSERV_LOG=${JSERV_HOME}/logs/jserv.log
>
> export JAVA_BINARY CLASSPATH JSERV_PROPERTY_FILE JSERV_LOCK_FILE
>
> case "$1" in
>   start)
>      ${JAVA_BINARY} -green -Duser.timezone=ECT org.apache.jserv.JServ
> $JSERV_PROPERTY_FILE  >> ${JSERV_LOG} 2>&1 &
>      ;;
>   stop)
>      kill `cat ${JSERV_LOCK_FILE}`
>      ;;
>   *)
>         echo "Usage: jserv.init {start|stop}"
>         exit 1
> esac
>
> --
> Morten Primdahl         Caput ApS       Tel +45 33 12 24 42
> [EMAIL PROTECTED]        Nygade 6        Fax +45 33 91 24 42
> http://www.caput.com    DK-1164 Kbh K
>
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> READ THE FAQ!!!!     <http://java.apache.org/faq/>
> Archives and Other:  <http://java.apache.org/main/mail.html/>
> Problems?:           [EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to