You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by David Legg <da...@searchevent.co.uk> on 2005/08/31 02:21:23 UTC
Running James as a Redhat service
Hi,
I'm trying James again after a two year gap. I previously ran James on a Windows server but am now using it it on a Redhat FC2 system.
I've followed the Wiki page (http://wiki.apache.org/james/RunAsService) as closely as I can to get James running as a service but it just won't automatically start at boot time. If I manually run a command like '/etc/init.d/james start' it is fine.
I've tried looking at various log files but I can't see any major problems.
I'm open to suggestions as I obviously don't want our email service to disappear any time the server is rebooted.
I have seen one or two people suggest using the jsvc application used by Tomcat. I think this is a splendid idea as I too would like to run it as something other than root. I had a quick look into this when I was setting the system up and came away with the impression that the Daemon loader object has to support an 'init' method instead of a 'Main' method for this to work. If anyone has successfully managed this... let me know!
Thanks,
David Legg.
Re: Running James as a Redhat service - SOLVED
Posted by David Legg <da...@searchevent.co.uk>.
Thanks Bud and Noel for your suggestions.
> David, Below is the script I use on Redhat FC3 to start up james. It is
> the same as what I used on FC2.
Bud, the script you showed is very similar to mine (except mine didn't have
the 'restart' action). But you gave me the clue I needed to solve the
problem.
The problem is simply that the JAVA_HOME environment variable isn't present
at boot time. This is why I could run it from my root login but not at boot
time. Once I included 'export JAVA_HOME=/usr/local/java' in the file it all
burst into life.
This leads me to an interesting observation. The phoenix.sh script that
comes with James tests for another script called 'sentenv.sh' but I can't
find this file anywhere in the James 2.2 distribution. The Wiki page I
referred to earlier mentions altering the bit of script which tests for this
file. But if the file doesn't exist it will make no difference.
Anyhow... thanks again for the help.
David.
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
Re: Running James as a Redhat service
Posted by Bud Bach <ww...@ameritech.net>.
David, Below is the script I use on Redhat FC3 to start up james. It is
the same as what I used on FC2. I put it in James' bin and created a
softlink from /etc/init.d/james to this file. Make sure it is
executable by root and check the JAVA_HOME path. To make it run at boot
time, run the command
chkconfig --add james
as root. Then you can use
/sbin/service james start
to start it and it should start at boot time. Make sure you have no
other apps running on say ports 25 and 110 depending on how you have
james configurred.
-- Bud
#!/bin/sh
# description: James is a 100% pure Java SMTP and POP3 Mail server, and
NNTP News server designed to be a complete and portab
le enterprise mail/messaging engine solution based on currently
available open messaging protocols.
#
# Amongst the benefits of James over other mail platforms is its support
for building custom mail handling applications.
# chkconfig: 2345 99 00
#
#### $ chkconfig --add james
export JAVA_HOME=/usr/java/jdk1.5.0_02
case "$1" in
'start')
echo "Starting James Mail Server: "
/usr/local/james-2.2.0/bin/phoenix.sh start
touch /var/lock/subsys/james
;;
'stop')
echo "Stoping James Mail Server: "
/usr/local/james-2.2.0/bin/phoenix.sh stop
rm -f /var/lock/subsys/james
;;
'restart')
echo "Restarting James Mail Server: "
/usr/local/james-2.2.0/bin/phoenix.sh restart
;;
*)
echo "Usage: $0 { start | stop | restart }"
;;
esac
exit 0
David Legg wrote:
>Hi,
>
>I'm trying James again after a two year gap. I previously ran James on a Windows server but am now using it it on a Redhat FC2 system.
>
>I've followed the Wiki page (http://wiki.apache.org/james/RunAsService) as closely as I can to get James running as a service but it just won't automatically start at boot time. If I manually run a command like '/etc/init.d/james start' it is fine.
>
>I've tried looking at various log files but I can't see any major problems.
>
>I'm open to suggestions as I obviously don't want our email service to disappear any time the server is rebooted.
>
>I have seen one or two people suggest using the jsvc application used by Tomcat. I think this is a splendid idea as I too would like to run it as something other than root. I had a quick look into this when I was setting the system up and came away with the impression that the Daemon loader object has to support an 'init' method instead of a 'Main' method for this to work. If anyone has successfully managed this... let me know!
>
>Thanks,
>David Legg.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
RE: Running James as a Redhat service
Posted by "Noel J. Bergman" <no...@devtech.com>.
Your could follow the mandrake instructions, but you also need to run
chkconfig to add the script and turn it on.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org