Setting up Wildfire to start on boot with Ubuntu

I’‘ve been searching high and low on how to automatically have wildfire start on boot with Ubuntu but have found no info. Tried following the comments in wildfire/bin/extras/wildfired but it doesn’'t seem to work. Anybody care to shed light for a newbie?

I don’'t use Ubuntu, and so what I suggest here may not work for you. But I suppose chkconfig or similar command is available in Ubuntu to help you setup a SysV style startup.

On RedHat, after you’'ve copied wildfired in /etc/init.d or /etc/rc.d/init.d, and chmod +x wildfired, you need to do as follows:

/sbin/chkconfig --add wildfired

/sbin/chkconfig wildfired on

Depending on the runlevel on your system, you have to make sure that wildfired is on for your runlevel (normally runlevel 3 or 5):

/sbin/chkconfig --list wildfired

If the SysV style doesn’'t work, an easy way is to insert wildfired execution line in your rc.local file.

Also, don’'t forget to create jive user whose home directory is /opt/wildfire because the default user to run wildfired is jive.

Hi John,

hopefully http://wiki.jivesoftware.org/display/WILDFIRE/LinuxInstallationGuide does also apply for Ubuntu. It contains what aznidin did write, anyhow on a more low-level way without the need for chkconfig.

LG

What exactly is an lv?

in the article you gave, it says and I quote “… # create a *lv *for java, …”

I’‘m trying to follow the instructions, and as soon as I’'ve successfully implemented it, I will mark this thread answered. Thanks in advance to aznidin and you it2000.

Ok, I’‘ve gotten to the point where I’'ve created the user jiveWF. When running the script, I get this error:

chmod: cannot access `/etc/rc.d/init.d/wildfired’’: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc0.d: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc1.d: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc2.d: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc3.d: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc4.d: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc5.d: No such file or directory

./wf.sh: line 25: cd: /etc/rc.d/rc6.d: No such file or directory

./wf.sh: line 29: /etc/rc.d/init.d/wildfired: No such file or directory

chmod: cannot access `/etc/rc.d/init.d/wildfired’’: No such file or directory

./wf.sh: line 33: cd: /etc/rc.d/rc0.d: No such file or directory

./wf.sh: line 33: cd: /etc/rc.d/rc1.d: No such file or directory

./wf.sh: line 33: cd: /etc/rc.d/rc6.d: No such file or directory

./wf.sh: line 37: cd: /etc/rc.d/rc2.d: No such file or directory

./wf.sh: line 37: cd: /etc/rc.d/rc3.d: No such file or directory

./wf.sh: line 37: cd: /etc/rc.d/rc4.d: No such file or directory

./wf.sh: line 37: cd: /etc/rc.d/rc5.d: No such file or directory

Hi,

“lv” is a logical volume for those who prefer one.

The errors in line 25 are OK, as you run it the first time.

The error in line 33 irritates me. Does Ubuntu has “/etc/rc.d/init.d/” and “/etc/rc.d/rc0.d/” … “/etc/rc.d/rc6.d/” directories?

If you skip this step now then Wildfire will not start automatically, but this could be OK for now.

LG

Upd: “chmod: cannot access `/etc/rc.d/init.d/wildfired’’:” is bad. It seems that the file was not created. It should look like:

#!/bin/sh
RETVAL=0
/usr/sbin/setenforce 0
su - jiveWF -c "/home/jiveWF/WF/bin/wildfire $1"
/usr/sbin/setenforce 1
RETVAL=$?
case $1 in
  start)
    touch /var/lock/subsys/wildfired
    echo $RETVAL >/var/lock/subsys/wildfired
    ;;
  stop)
    rm -f /var/lock/subsys/wildfired
    ;;
esac
exit $RETVAL

I’'ll attach it in the Wiki, so one can download it.

Ubuntu doesn’'t have /etc/rc.d/. At least in my system, it only has /etc/rc0.d/, /etc/rc1.d/, /etc/rc2.d/, /etc/rc3.d/, /etc/rc4.d/, /etc/rc5.d/, /etc/rc6.d/ and /etc/rcS.d/.

So how do I go about the problem now?

Message was edited by: execute

Hi,

so change “cd /etc/rc.d/rc$.d …” to “cd /etc/rc$.d …” in the script.

I assume you have an /etc/init.d directory? So you’'ll need to change also this path in the script.

LG

A quick way is to do:

ln -s /etc /etc/rc.d

The script is still at its infantry stage. A check on the version of OS should be included.

Hi aznidin,

mm, one could make this script too complex with an OS check. I’'ll create a variable so one can adjust the path depending on the OS. This should be fail-safe and if it fails then the user is responsible for the failure (;

LG

Thanks for the help!

Now that Wildfire is starting up on boot, it opens another problem. When I go to the admin page, it gives an error:

Home not found. Define system property “wildfireHome” or create and add the wildfire_init.xml file to the classpath.

How do I fix this?

Hi LG,

You’'re correct. Afterall, the script are not meant to run on Windowz :). So checking on existence of rc path should suffice.

Hi,

it really makes me wonder what’'s going on with the default bin/wildfire script. I did not yet complete the documentation and a light wildfire script, if you can live with a script that does not stop Wildfire you can try to use it to start Wildfire:

#!/bin/sh
JVM=/opt/java/jdk1.5.0_08/jre/bin/java case "$1" in
  start)
    echo "Starting wildfire"
    nohup ${JVM} -server -jar ../lib/startup.jar >../logs/SDTOUT.log 2>../logs/SDTERR.log &
    ;;
  stop)
    echo "Shutting down wildfire"
    # TODO
    ;;
  *)
    echo "Usage: $0 {start|stop}"
    exit 1
  ;;
esac

& in = & and still a forum bug

Ok, I fixed the Home not found error by changing the owner of the directory wildfire to jive. Thanks again guys. Was seriously going to revert to using ejabberd! Glad you guys helped out. Will try to post what I’'ve done exactly, for other Ubuntu people out there.

Here’'s how I did it:

  1. I followed the Java installation part in http://wiki.jivesoftware.org/display/WILDFIRE/Linux+Installation+Guide

  2. The Wildfire Installation part in http://wiki.jivesoftware.org/display/WILDFIRE/Linux+Installation+Guide was a bit off for

Ubuntu so here are some changes:

a. Adding the user jiveWF gave me errors, I think ubuntu doesn’'t like the WF in jiveWF so I just added a jive user.

b. Use this script instead:


start script here-------

#create the wildfired script

cat > /etc/init.d/wildfired << EOF

#!/bin/sh

RETVAL=0

/usr/sbin/setenforce 0

su - jive -c “/home/jive/wildfire/bin/wildfire $1”

/usr/sbin/setenforce 1

RETVAL=$?

case $1 in

start)

touch /var/lock/subsys/wildfired

echo $RETVAL >/var/lock/subsys/wildfired

;;

stop)

rm -f /var/lock/subsys/wildfired

;;

esac

exit $RETVAL

EOF

chmod 755 /etc/init.d/wildfired

  1. uninstall old rc scripts

rm -f /etc/init.d/wildfired

for i in 0 1 2 3 4 5 6

do

  1. install new rc scripts
    cd /etc/rc.d/rc$.d && rm -f ???wildfired
    done echo ‘‘su - jive -c “/home/jive/wildfire/bin/wildfire $1”’’ >/etc/init.d/wildfired
    chmod 755 /etc/init.d/wildfired
    for i in 0 1 6
    do
    cd /etc/rc$.d && ln -s …/init.d/wildfired K80wildfired

done

for i in 2 3 4 5

do

cd /etc/rc$.d && ln -s …/init.d/wildfired S20wildfired

done


end script here-------

I think this will produce an error but it2000 said a few posts up that it shouldn’‘t bother you. I’'m not totally sure it will produce the error.

after this, you can follow the rest of the guide in http://wiki.jivesoftware.org/display/WILDFIRE/Linux+Installation+Guide right about in the part where it says “login as jiveWF…” but be sure to login as jive and not jiveWF.

Also, the last line in the part where you install wildfire should be:

ln -s $ wildfire and NOT ln -s $ WP

Be sure that /home/jive/wildfire is owned by jive and not by root so as to not get a Home not found error.

Good luck,

John

Hi John,

“ln -s $ wildfire and NOT ln -s $ WF” is a bad idea. If you try to update Wildfire you’'ll overwrite your current installation.

And

# install new rc scripts
echo ''su - jive -c "/home/jive/wildfire/bin/wildfire $1"'' >/etc/init.d/wildfired
chmod 755 /etc/init.d/wildfired
for i in 0 1 6

should read

# install new rc scripts
for i in 0 1 6

, otherwise the wildfire script gets overwritten and it will not work with SELinux. This I did update in the Wifi right now.

And I’‘ll change the user to lower case, but as we’'ll see a “jiveCM” or jivecm user soon it will still be named jivewf.

LG

Ahh, now I understand why you used WP. Thanks for clearing that up, anyway this thread should be helpful enough for Ubuntu users.

Hi,

i had got nearly to the bottom of this thread then found this :-

http://www.jivesoftware.org/community/thread.jspa?messageID=131004&#131004

the second post by bhcleek says :-

Copy the wildfired script from $WILDFIRE_HOME/bin/extra to /etc/init.d and then using sudo run:

update-rc.d wildfired defaults

this is all you need !!!

hope this helps. It works for me.

the normal stop start works fine as well

Jeff