Help JM start at boot suse 9.3

Same to you. Thanks for letting me double my number of posts here. :stuck_out_tongue:

Ah, the original problem might be caused by a bug that seems to be fixed in the new alpha release (2.3.0 alpha): ā€œFixed jive-messengerd script to have unix line endings.ā€

Very cool app! I have installed Jive Messenger, and am about to take it for a spin. Saw this thread though, and took a detour to solve the start/stop problem. Hereā€™'s my solution for SUSE 9.3 Proā€¦

Use this start/stop script in place of the default, and put it in the /etc/init.d directory.

/etc/init.d/jive-messengerd

#!/bin/sh

  1. jive-messengerd

  1. chkconfig: 2345 20 80

  2. description: Used to start and stop the jive messenger XMPP server

  3. Script used to start jive messenger as daemon

  4. The script has currently been tested on SUSE Linux Pro 9.3.

  1. before running this script make sure $MESSENGER_HOME/bin/messenger is

  2. executable by the user you want to run messenger as

  3. (chmod +x $MESSENGER_HOME/bin/messenger)

  1. This script should be copied into /etc/init.d and linked into

  2. your default runlevel directory.

  3. You can find your default runlevel directory by typing:

  4. grep default /etc/inittab

  1. Link to the directory like follows

  2. cd /etc/rc.d

  3. ln -s ā€¦/init.d/jive-messengerd $90jive-messengerd

  1. BEGIN INIT INFO

  2. Provides: jive-messengerd

  3. Required-Start: $network $local_fs $syslog

  4. Required-Stop:

  5. Default-Start: 3 5

  6. Default-Stop: 1 2

  7. Short-Description: Used to start and stop the jive messenger XMPP server

  8. Description: Script used to start jive messenger as daemon.

The script has currently been tested on SUSE Linux Pro 9.3.

  1. END INIT INFO

. /etc/rc.status

  1. Shell functions sourced from /etc/rc.status:

  2. rc_check check and set local and overall rc status

  3. rc_status check and set local and overall rc status

  4. rc_status -v ditto but be verbose in local rc status

  5. rc_status -v -r ditto and clear the local rc status

  6. rc_failed set local and overall rc status to failed

  7. rc_reset clear local rc status (overall remains)

  8. rc_exit exit appropriate to overall rc status

  9. First reset status of this service

rc_reset

  1. If a messenger home variable has not been specified, try to determine it

  2. (See /etc/sysconfig/jive-messengerd for environment variable settings)

if ; then

if [ -d ā€œ/opt/jive_messengerā€ ]; then

MESSENGER_HOME="/opt/jive_messenger"

elif [ -d ā€œ/usr/local/jive_messengerā€ ]; then

MESSENGER_HOME="/usr/local/jive_messenger"

else

echo ā€œCould not find Jive Messenger installation under /opt or /usr/localā€

echo ā€œPlease specify the Jive Messenger installation locationā€

echo ā€œin environment variable MESSENGER_HOMEā€

exit 1

fi

fi

  1. Set the name of the running process.

  2. (NOT the same as the name of the binary)

MESSENGER_BIN="$MESSENGER_HOME/jre/bin/java"

function execCommand() {

OLD_PWD=pwd

cd $MESSENGER_HOME/bin

CMD="./messenger $1"

su -c ā€œ$CMDā€ $MESSENGER_USER &

cd $OLD_PWD

}

case ā€œ$1ā€ in

start)

echo -n ā€œStarting jive-messengerd XMPP serverā€

execCommand ā€œstartā€

  1. Remember status and be verbose

rc_status -v

;;

stop)

echo -n ā€œShutting down jive-messengerd XMPP serverā€

execCommand ā€œstopā€

  1. Remember status and be verbose

rc_status -v

;;

try-restart)

$0 status >/dev/null && $0 restart

  1. Remember status and be quiet

rc_status

;;

restart)

  1. If first returns OK call the second, if first or

  2. second command fails, set echo return value.

$0 stop && sleep 2 && $0 start

  1. Remember status and be quiet

rc_status

;;

force-reload)

  1. Exclusive possibility: Some services must be stopped

  2. and started to force a new load of the configuration.

echo -n ā€œReload jive-messengerd XMPP serverā€

killproc -HUP $MESSENGER_BIN

  1. Remember status and be verbose

rc_status -v

;;

reload)

  1. Exclusive possibility: Some services must be stopped

  2. and started to force a new load of the configuration.

echo -n ā€œReloading jive-messengerd XMPP serverā€

killproc -HUP $MESSENGER_BIN

  1. Remember status and be verbose

rc_status -v

;;

status)

echo -n ā€œChecking for jive-messengerd XMPP serverā€

  1. Check status with checkproc(8), if process is running

  2. checkproc will return with exit status 0.

checkproc $MESSENGER_BIN

rc_status -v

;;

*)

echo ā€œUsage: $0 {start|stop|status|try-restart|restart|force-reload|reload}ā€

exit 1

;;

esac

rc_exit

/code

Also put this SUSE Sysconfig file in the /etc/sysconfig directory, (yes itā€™'s the same name as the script above, but a different location). No special file attributes need to be set; root/root for ID/group, not executable. It exports the required environment variables before running /etc/init.d/jive-messengerd automagically.

/etc/sysconfig/jive-messengerd

Path: Network/Other/Jive-Messenger

  1. Description: Basic configuration of the jive-messenger daemon

  2. Type: string

  3. Default: ā€œā€

  4. Config: jive-messengerd

  1. Type: string(/opt/jive_messenger,/usr/local/jive_messenger)

  2. Default: ā€œ/opt/jive_messengerā€

  3. Config: jive-messengerd

  1. Set this to tell this script where messenger lives

  2. If this is not set the script will look for /opt/jive_messenger, then /usr/local/jive_messenger

  3. MESSENGER_HOME=

MESSENGER_HOME="/opt/jive_messenger"

  1. Type: string

  2. Default: ā€œjiveā€

  3. Config: jive-messengerd

  1. If there is a different user you would like to run this script as,

  2. change the following line

MESSENGER_USER=jive

/code

You can run the default redhat-postinstall.sh script as root, and it works fine under SUSE 9.3.

/opt/jive_messenger/bin/extra/redhat-postinstall.sh

There is one bug I couldnā€™'t quite solveā€¦ When starting the script from withing ā€œyast2 runlevelā€, jive-messengerd fails to exit and hangs YAST2, (but the JM server does start). Other methods do work though, during boot and from a command line with:

/etc/init.d/jive-messengerd start

Maybe somebody can figure that one out and carry this ball into the endzone.

Brett