This was not fun to solve.  For some reason, the phoenix.pid file is getting
left behind. So when it reboots is doesnt startup - phoenix.sh just says
it's started! i was being fooled by the shell script :(

Anyway, i found a couple of ways round this - simply change
/etc/init.d/james so that the start part deletes the pid file!
but this is sloppy as you could start it twice using service start.

So, the better way is to alter phoenix.sh so it doesnt just look for the
file - it verifies that the pid file is a process! This is my first attempt
at shell coding, so it's a bit unprofessional looking, but it works!

Simply replace the origional code:

        if [ -f $PHOENIX_PID ]
        then
            echo "Already Running!!"
            exit 1
        fi

With:

if [ -f $PHOENIX_PID ]
then
        phpid=`cat $PHOENIX_PID 2>/dev/null`
        piddata=`ps $phpid | grep phoenix.home 2>/dev/null`
        if [ "$piddata" != "" ]
        then
                echo "Already Running!!"
                exit 1
        fi
fi

Not sure wether the phoenix team would be interested in doing somthing
similar so as to avoid this kind of problem!

Daniel.

-----Original Message-----
From: Daniel Perry [mailto:[EMAIL PROTECTED]
Sent: 03 March 2004 17:55
To: James Users List
Subject: RE: load at bootup


Ok, i went down this service approach (tried both approaches - symlink to
phoenix, and the script noel sent).

It works a treat with "service james start", "service james stop".

BUT, if i reboot, it doesnt start up properly. (this only if it was running
at reboot).

Phoenix does start because if you try to start james again it says it's
already running! However, it isnt listening on any ports. stop it and start
it and it's fine.

Note, it also doesnt generate any log files.

To clarrify:

if james is running fine, and i do:
# shutdown -r now"
when the server reboots, james is running, but doesnt listen!

if james is running fine, and i do:
# service james stop
# shutdown -r now
when the server reboots, james is running, and is listening!

Any ideas? cos i'm stumped!

Thanks,

Daniel.



-----Original Message-----
From: Noel J. Bergman [mailto:[EMAIL PROTECTED]
Sent: 01 March 2004 16:29
To: James Users List
Subject: RE: load at bootup


Serge Knystautas wrote:
> Daniel Perry wrote:
> > How would I go about starting james on bootup (Linux)?
> > I'm using Fedora core 1 if that's any help!

> I create a symlink to make James a service, then set that service to
> start at boot time...

> ln -s /usr/local/james/bin/phoenix.sh /etc/init.d/james

> Then put a link to that in rc3.d or however you want to make the service
> start at boot time.

I use the attached.  Place it, or a symlink, in /etc/rc.d/init.d.  Then run

 $ chkconfig --add james

to have it installed.  See "man chkconfig" for other options.  The easy way
to access the scripts is the service command, e.g.,

 $ service james [start | stop | restart]

phoenix.sh has some options not yet supported in this script, but doesn't
integrate with the runlevel level scheme.

        --- Noel


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



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

Reply via email to