TL;DR
This is a bug: the OpenFire service wasn’t able to detect Java location.
Workaround: You need to manually specify JAVA_HOME environment variable.
First execute update-alternatives --display java
and copy the path to a JVM folder without the /bin/java
.
Then edit /etc/environment and add the line:
JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
You can use sudo -e /etc/environment
to edit the file.
You’ll need to reboot after this so that the env var will be picked.
Alternatively you can change the JAVA_HOME in the /etc/default/openfire
. Then you may avoid reboot.
You can restart the OpenFire with the /etc/init.d./openfire restart
With the /etc/init.d./openfire status
you can check if it running.
Long description
I created the bug in Jira and made a PR with a fix
https://igniterealtime.atlassian.net/jira/software/c/projects/OF/issues/OF-3106
The old way of running the OF was to to call /etc/init.d/openfire
script which uses old System V style. You can also call it with a command service openfire start
.
The Debian migrated from the SysV to SystemD long time ago and the SystemD can run the old SysV scripts. But the preferred way for the SystemD is to use own daemon/service configuration in the INI-like file called unit. So in the OF 5.0.0 was added such a unit file in the /usr/lib/systemd/system/openfire.service
. But the old /etc/init.d/openfire
is installed too for those who may run it manually. The systemd should ignore the old /etc/init.d./openfire
and use the unit file.
Note that there is an issue now that after installing OF debian package the openfire service is not registered so we need to run manually commands to enable it:
sudo systemctl daemon-reload
sudo systemctl enable openfire
sudo systemctl restart openfire
In the next releases the Debian package will do this itself in the post installation script.
Meanwhile you may need to run it manually. After this your SystemD shoud switch to use the unit file instead of SysV script, at least when making a fresh install. But maybe there is some problems during upgrade: maybe the SystemD will prefer the old SysV script instead. I checked this scenario but maybe missed something. Anyway normally you shouldn’t see the old SysV script.
So in your case the systemctl status openfire
shows
/etc/init.d/openfire start (code=exited, status=0
This means that the systemd started the old SysV script /etc/init.d/openfire
but it stopped with exit code 0 i.e. it was shut down without any problems. This is not true, in fact the script had an error but it wasn’t processed correctly.
All the printed messages to stdout and stderr the SystemD redirects to the own logging journal that you can read with journalctl -u openfire -f
command. The last strings from the log you see in the systemctl status openfire
: and you may the best java alternative in:
i.e. it wasn’t able to detect the JVM folder from the update-alternatives
command output.
Other details is described in the bug report and PR.
P.S. Thank you for mentioning me for the SystemD migration issues.