I use the following for starting and stopping James on startup in RedHat
7.2.  I tried to get the 'daemon' command to work, but couldn't get it to
start so I gave up.

Eric Weidner
Sr. Consultant
EJB Solutions Inc.


#!/bin/sh
# Startup script for James Mail server
#
# chkconfig: 2345 95 92
# description: Run James Mail server

[ -f /opt/james/bin/run.sh ] || exit 0

start() {
    echo -n  "Starting James Mail Server: "
    JAVA_HOME=/usr/java;export JAVA_HOME
    cd /opt/james/bin
    nohup /opt/james/bin/run.sh &
    RETVAL=$?
    echo
    return $RETVAL
}

stop() {
    echo -n "Shutting down James Mail Server "
    ps -auxwwwww | grep valon | awk '{print $2}' | xargs -i kill {}
    echo killing run shell
    ps -auxwwwww | grep james | awk '{print $2}' | xargs -i kill {}
    echo
    return 0
}

case "$1" in
        start)
            start
            ;;

        stop)
            stop
            ;;

        *)
            echo "Usage: james {start|stop}"
            exit 1

esac

exit 0


----- Original Message -----
From: "wursttrooper" <[EMAIL PROTECTED]>
To: "James Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 13, 2002 9:59 AM
Subject: Re: JAMES shuts down when ssh session ends


> There is a workaround for that, using the startproc tool.
>
> startproc /usr/local/james/bin/run.sh
>
> this works for me, until starting/stopping is implemented in JAMES. But
> there is a drawback. Stopping JAMES is only possible via
>
> killall java
>
> This is especially painful if you are also running other java servers
(e.g.
> tomcat).
>
> Eike
>
> ----- Original Message -----
> From: "test" <[EMAIL PROTECTED]>
> To: "James Users List" <[EMAIL PROTECTED]>
> Sent: Wednesday, February 13, 2002 5:35 PM
> Subject: JAMES shuts down when ssh session ends
>
>
> > I use ssh instead of telnet. When I login to my server with ssh and
start
> > james using "./run.sh &" and then close my terminal/ssh session JAMES
will
> > shutdown too. I looked at my processes "ps -A f" and noticed that JAMES
is
> > starting as a child process of my ssh session. How do I start JAMES
> remotely
> > without it starting as a child process of ssh. Shouldn't the "&" allow
for
> > this?
> >
> > Brandon Goodin
> > Phase Web and Multimedia
> > P (406) 862-2245
> > F (406) 862-0354
> > [EMAIL PROTECTED]
> > http://www.phase.ws
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>



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

Reply via email to