Running openfire as a service


Firstly i have to say that my linux experiance is severely limited, but as fate would have it, i am administrating a network with a linux server for a NPO

I am running openfire on a CentOS 4 box, and although openfire runs fine when i run ./ from /opt/openfire/bin, i have no idea how to get it installed as a service, i have run, but the service is not actually running. how do i get openfire working as a service on my machine



you may want to take a look at as it discusses the issues which one may hit.


If you used the rpm install for openfire 3.3.1, then the service will be installed by the rpm. chkconfig --list openfire to see if it is installed and on in runlevel 3 & 5 ) You should see something like

$ chkconfig --list openfire

openfire 0:off 1:off 2:on 3:on 4:on 5:on 6:off

If you are on an older version:

  1. copy <OPENFIRE_HOME>/bin/extra/openfired to /etc/init.d

  2. chkconfig --add openfired

  3. service openfired start

/etc/init.d is the library for service scripts

chkconfig is used to add/remove services from automatically starting

service command starts/stops services.

I had to make a couple of changes to the openfired script to have it work properly

Added start to this line (about line 72)

su -s /bin/sh -c “$OPENFIRE_CMD start” $OPENFIRE_USER > nohup.out 2>&1 &

After the RETVAL=$? (about line 73) , add the following

sleep 5


Then on this line (about line 76) change the $! to $OPENFIRE_PID


Finally, in the stop() section there is a typo … it should read OPENFIRE_PIDFILE instead of OPENFILE_PIDFILE (about line 91 )

[ -f “$OPENFIRE_PIDFILE” ] && kill `cat $O