How to make autostart of openfire in linux fedora

Hello there

I am newbie in linux i have a difficult problem when my server is restarted then the openfire is not running i have to type again in the terminal

always happened to me like this… is there any way how to autostart the program of openfire.

Thank you

Hi,

do you have SE Linux enabled? This may cause trouble.

Are you using the RPM or the tar.gz version? The latter has a bin/extra directory to install startup scripts.

You may also want to take a look at Simple Start Scripts - that’s how I start Openfire.

LG

Thats the way I do it:

I’m using the .tar.gz Version, not sure if this works with the RPM, too.

Basically I’m using the extra/openfired script shipped with Openfire. But this needs some modifications:

For some historical reasons the script calls openfire.sh, which does not exist in newer versions. Never mind, just create a symlink:

shell> cd /opt/openfire/bin
shell> ln -s openfire openfire.sh

Probably you want to set some VM parameters or use a custom JRE. Open the script openfire with your favorite editor and modify the variables to match your needs. For example:

INSTALL4J_ADD_VM_PARAMS="-Xms256m -Xmx256m"
INSTALL4J_JAVA_HOME_OVERRIDE=/usr/java/jdk1.6.0_06

Now you need to modify the extra/openfired script. At first make it executable:

shell> cd /opt/openfire/bin/extra
shell> chmod u+x openfired

Modify the extra/openfired script with your favorite editor. Maybe you want to change the user which runs Openfire:

export OPENFIRE_USER=openfire

In order to get automatic startups/shutdowns to work, add the following as first line of function start():

touch /var/lock/subsys/openfired

Now you need a few more symlinks. Thats what it looks on my two systems:

[martin@jabber ~]$ ls -l /etc/init.d/openfired
lrwxrwxrwx 1 root root 33 Dec 9 13:51 /etc/init.d/openfired -> /opt/openfire/bin/extra/openfired
[martin@jabber ~]$ ls -l /etc/rc?.d/*openfired
lrwxrwxrwx 1 root root 19 Dec 9 13:51 /etc/rc0.d/K01openfired -> ../init.d/openfired
lrwxrwxrwx 1 root root 19 Dec 9 13:31 /etc/rc3.d/S70openfired -> ../init.d/openfired
lrwxrwxrwx 1 root root 19 Dec 9 13:43 /etc/rc6.d/K01openfired -> ../init.d/openfired

The directories /etc/rcX.d are used to start or stop applications in runlevel X. The scripts are called in alphabetically order. The first letter indicates if the application should be started (“S”) or killed (“K”). Your systems calls the linked script with parameter “start” to start an application. To stop an application it checks it the application is running (checks if /var/lock/subsys/openfired does exist) and calls the linked script with “stop”.

Make sure that for example your database or your network does startup before Openfire. Analogous it should be stopped after Openfire.

If you are using the tar.gz insted of the rpm for Fedora then you’ve made life harder to start with, but I digress.

You should check to see if it’s already installed as a service.

As root:

chkconfig -l | grep openfire

You should see something like this:

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

You notice 3 & 5 are set to on ? That means the openfire service will be started at run level 3 (command line) and 5 (gui). If you see openfire as set to all OFF then you need to configure it to startup at 3 and 5 with chkconfig openfire 35

Hello thanks for the reply…

I used rpm and i never try tar.gz to install in my fedora…

please reply

thanks

You should check to see if it’s already installed as a service.

As root:

chkconfig -l | grep openfire

You should see something like this:

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

You notice 3 & 5 are set to on ? That means the openfire

service will be started at run level 3 (command line) and 5 (gui). If

you see openfire as set to all OFF then you need to configure it to

startup at 3 and 5 with chkconfig openfire 35