[EMAIL PROTECTED] schrieb:
(...)
3. The Lenya console to be redirected to a log, preferably with
rotation when it reaches a certain size or the month changes.  I'll
worry about that later.

add "> console.log 2>&1" to the Java line.
Log rotation is not meaningful here; this log only serves to show whether startup and shutdown worked OK.


"there is no standard location to put this PID file."
The OS standard locations do not matter.  I will store it in the Lenya
directory.

In that case remember that you are in a different directory when starting from /etc/init.d.



I do agree that it would be nice if the cocoon.sh (and hence the lenya.sh)
had "start" and "stop" options out-of-the-box, which wrote the PID
somewhere and used that.

It sounds like I need to create a single shell file with start, stop,
restart, and status commands.  It will probably bypass lenya.sh and
call java directly.  If I get it working, it will be documented on my
site (and Gregor can decide if it should be merged into trunk.)

Just add a & to the end of the Java call in the lenya.sh and store the PID from that call in some file.

Bottom line, you should end up with something like
case "$ACTION" in
 start)
    $JAVA ... > console.log 2>&1 &
    echo $! > lenya.pid
    ;;
 stop)
    kill `cat lenya.pid`
    rm lenya.pid
    ;;

But like I said, this assumes everything is in the current directory. Things like /var/run and /var/log would be "nicer" but are different on every system, plus you will have permission problems. You don't want to Servlet container to run as root. So if you start all this from an init.d script, do an su within it.


--
Wolfgang

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to