powered by Jive Software

Openfire Daemon not stopping

Hi guys

I did a search for this, but nothing.

If I run the command: ./opt/openfire/bin/openfire stop - the daemon doesn’t stop

Users are still logged in and able to send messages

Any ideas?

Thanks a mill


The shutdown process can take a very long time as data is flushed out and sessions are closed. How long did you wait to see if it worked?

also, does /opt/openfire/bin/openfire even exist?


Hi Daryl

Thanks for the reply

Yeah /opt/openfire/bin/openfire exists, I left it for about 10 minutes

I then ran ./opt/openfire/bin/openfire status which shows “The Daemon is not running”

I thought all was fine till a user messaged me lol!

I’m using Openfire 3.8.1 on a Ubuntu Server

It should also output a result “Openfire shutting down” or something like that.

Yeah it did, soemthing like the deamon is now shutting down, which is usual

I’ll try it again but before I do is there anything else I can check to help troubleshoot this?

You should run this command with the same user, who is running the deamon. I mean the user having rights to the openfire folder.

Hi wroot

thanks for the help (and the great work you do around here)

Yeah I just run the command as root - any logs I can post / read if it doesn’t work?

Thanks a mill

Well, i’m not sure it will write anything into logs while it shutting down (/opt/openfire/logs). Usually it just shuts down without issues

You said it said that daemon is shutting down. I think it says more like “Openfire stopping” or like that and it hangs until it stops and then you get blank command prompt again. And i don’t use . as a prefix, just run “/opt/openfire/bin/openfire stop” as a command, though maybe no difference in that. I do use daemon to run it on server startup, which sits in /etc/rc.d/ with other daemons (Arch linux), but i use the above command, which shuts down the Openfire process itslef and doesn’t do anything with the daemon (i think this daemon is more like a startup shortcut).

Run the shutdown with ‘sh -x /opt/openfire/bin/openfire stop’ and see what it is doing. I’ve seen instances where there is bad data in the pid file (two pids for example), that causes the stop to fail.

You could also try using the init.d script and doing the same thing to see if it works.

Thanks for all the help

I’ll test this tomorrow and reprot back


I have the same kind of problem.

I wrote a cron job to restart openfire everyday in order to delete history for some rooms.

And after a few days, the restart doesn’t work.

I notice there are several process for openfire daemon, and the cronjob restart the bad one.

Even if I kill all process and start Openfire, new process are launched a few time after.

I use Openfire 3.8.1 on Debian 6

Exemple for the command “ps -ef | grep openfire” :

openfire 25801 1 0 May01 ? 00:01:05 /usr/lib/jvm/default-java/bin/java -server -DopenfireHome=/usr/share/openfire -Dopenfire.lib.dir=/usr/share/openfire/lib -classpath /usr/share/openfire/lib/startup.jar -jar /usr/share/openfire/lib/startup.jar

openfire 25970 1 0 Apr29 ? 00:06:00 /usr/lib/jvm/java-6-sun/bin/java -server -DopenfireHome=/usr/share/openfire -Dopenfire.lib.dir=/usr/share/openfire/lib -classpath /usr/share/openfire/lib/startup.jar -jar /usr/share/openfire/lib/startup.jar

The good one is “/usr/lib/jvm/java-6-sun/bin/java” but I don’t know how the other one is launched.

Any idea ?

Ok I’ve tested this as follows:

root@openfire-server:/# ./opt/openfire/bin/openfire stop

Shutting down openfire

The daemon is not running.


root@openfire-server:/# ./opt/openfire/bin/openfire status

The daemon is stopped

I’m still logged into Openfire, I can log off and log back in.

If I run the command suggested by Dave:** ‘sh -x /opt/openfire/bin/openfire stop’ **it outputs the following, still the same result


I’m not sure how running another JVM with a stop parameter is supposed to stop the one you have running, but that is what the script is doing.

Use the /opt/openfire/bin/openfirectl script to status/stop/start it instead.

I’ve no idea what you mean,sorry

I ran ** ./opt/openfire/bin/openfire stop** and it doesn’t stop the daemon, it used to

Is there a openfirectl script in the same directory? Kill the java instance you have, then start it with the openfirectl command - That is actually a init.d script that seems like it work stop/start it properly.

Thanks for the reply David

Yeah there’s an “openfirectl” i’ll have to wait till a little later to test this out, thanks

Here is the solution to my issue :

The user environnment was not loaded with cron. So all Java paths listed in openfire script (/etc/init.d/openfire) were used.

The solution is to stop all openfire process and add the access to environnment in crontab :

00 20 * * * . /etc/profile; /etc/init.d/openfire restart

(instead of : 00 20 * * * /etc/init.d/openfire restart)

So, just the current java path is used.

So with the lastest version of openfire out I thought I would upgrade and shutdown openfire first

Tested the above and openfire still isn’t shutting down, dispite the console output saying it is

I ran sh -x ./opt/openfire/bin/openfire stop and if gives me this output here:


If I do ps -x I can see this process:

949 ? Sl 170:34 /usr/bin/java -server -Dinstall4j.jvmDir=/usr -Dexe4j.moduleName=/opt/openfire/bin/S20openfire -classpath /opt/openfire/.install4j

If I kill process 949 above, it closes openfire

Pretty sure the part in bold is my problem