• autostart openkm ?

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #4277  by me.myself53
 
Hi all ,


I have installed openkm 4.0 , on /opt , on a ubuntu hardy and , I try to autostartt but it doesn't sound that works .

I have write this script on /etc/init.d/
Code: Select all
#!/bin/sh
cd /opt/jboss-4.2.3.GA/ 
./run:sh 
and give the right to execut with
Code: Select all
chmod +x openkm 
and then update it with update-rc command :
Code: Select all
root@server:/etc/init.d# update-rc.d openkm defaults
 Adding system startup for /etc/init.d/openkm ...
   /etc/rc0.d/K20openkm -> ../init.d/openkm
   /etc/rc1.d/K20openkm -> ../init.d/openkm
   /etc/rc6.d/K20openkm -> ../init.d/openkm
   /etc/rc2.d/S20openkm -> ../init.d/openkm
   /etc/rc3.d/S20openkm -> ../init.d/openkm
   /etc/rc4.d/S20openkm -> ../init.d/openkm
   /etc/rc5.d/S20openkm -> ../init.d/openkm
But it doesn't auto start at all

Any idea ?
 #4278  by jllort
 
I think you need working more on the script.

Try looking on google "linux jboss service" better include your linux distribution "how to ubuntu jboss service" and you'll get interesting results on how to make it. In /bin jboss includes some scripts, but I think you'll found more interesting doing yourself with information in google than use that directly.

The registration update-rc command seem right, but script not.
 #4296  by pavila
 
Try to run the startup script manually:
Code: Select all
 $ /etc/init.d/openkm start
An will see if any error occurs.
 #4526  by Avon
 
This init.d script works for Debian Lenny (Linux)

Be sure to:
- check the paths to the script (these could be different on your machine);
- save this script as file 'jbossokm';
- chmod the file to 755;
- put the file in the /etc/init.d directory.

You can check the script with:
# /etc/init.d/jbossokm start
and if it has been started you can stop it with:
# /etc/init.d/jbossokm stop

Then, if everything works as expected...
- run as root: 'update-rc.d jbossokm defaults'
The effect will be that at boot time openKM will be started automatically. At shut down time, it will be stopped automatically. At restart time it will...hey, you're smart, you can figure this out yourself 8)

Thanks to:
pavila and bytedevil for their inspiration!

Greetz,
Avon
Code: Select all
#! /bin/sh
# /etc/init.d/jbossokm: Start and stop JBoss Application Service

ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_START_SCRIPT=/opt/jboss-4.2.3.GA/bin/run.sh
JBOSS_STOP_SCRIPT=/opt/jboss-4.2.3.GA/bin/shutdown.sh

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0

start() (
	$ECHO -n "Starting JBoss"
	su -c "$JBOSS_START_SCRIPT -b 0.0.0.0 > /dev/null 2> /dev/null &"
	$ECHO "."
	)

stop () (
	$ECHO -n "Stopping JBoss"
	su -c "$JBOSS_STOP_SCRIPT -S > /dev/null &"
	$ECHO "."
	)

case "$1" in
      start )
            start
            ;;
      stop )
            stop
            ;;
      restart )
            stop
            sleep 30
            start
            ;;
      * )
            $ECHO "Usage: jbossokm {start|stop|restart}"
            exit 1
esac

exit 0
 #5170  by baiki
 
Totally sweet! For the Ubuntu 10.04 server (32 bit) I just changed a few things. I use a normal user (in this case user baiki). And during operation start/stop has to be invoked as user root (as in sudo):

My /etc/init.d/jbossokm:
Code: Select all
ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_START_SCRIPT=/home/baiki/okm/4.1/bin/run.sh
JBOSS_STOP_SCRIPT=/home/baiki/okm/4.1/bin/shutdown.sh
OKM_USER=baiki

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0

start() (
   $ECHO "Starting JBoss OKM."
   rm -rf /path/to/server/default/tmp
   rm -rf /path/to/server/default/work
   rm -rf /path/to/server/default/log
   su -c "soffice -headless -accept=\"socket,host=127.0.0.1,port=8100;urp;\" -nofirststartwizard" $OKM_USER
   su -l -c "$JBOSS_START_SCRIPT -b 0.0.0.0 > /dev/null 2> /dev/null &" $OKM_USER
   $ECHO "Done."
   )

stop () (
   $ECHO "Stopping JBoss OKM. "
   su -l -c "$JBOSS_STOP_SCRIPT -S > /dev/null &" $OKM_USER
   sleep 10
   $ECHO "Done."
   )

case "$1" in
      start )
            start
            ;;
      stop )
            stop
            ;;
      restart )
            stop
            sleep 30
            start
            ;;
      * )
            $ECHO "Usage: jbossokm {start|stop|restart}"
            exit 1
esac

exit 0
Don't try to start this script more than once, I guess it'll confuse the system totally. For the shutdown procedure, is there an elegant way to stop soffice (or is an ordinary shutdown OK?)?

Suggestions? Help?
Thanks a lot!
Baiki

PS: I used additionally these links:
http://chiralsoftware.com/linux-system- ... yment.seam
http://community.jboss.org/wiki/startjb ... twithlinux
Last edited by baiki on Thu Jun 03, 2010 11:02 pm, edited 2 times in total.
 #5244  by seti
 
Script working perfectly on ubuntu 10.04 server

As my repository is on an external NAS, I had to make sure that nas is mounted before starting OpenKM
 #5247  by baiki
 
seti wrote:Script working perfectly on ubuntu 10.04 server

As my repository is on an external NAS, I had to make sure that nas is mounted before starting OpenKM
Indeed it looks like we do have the same issue at hand. My latest startup script in conjunction with crappy LVM setup :-(
Code: Select all
ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_START_SCRIPT=/home/baiki/okm/4.1/bin/run.sh
JBOSS_STOP_SCRIPT=/home/baiki/okm/4.1/bin/shutdown.sh
OKM_USER=baiki

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0

start() (
   $ECHO "Starting OKM (JBoss, davfs2)"
   rm -rf /home/baiki/okm/4.1/server/default/tmp
   rm -rf /home/baiki/okm/4.1/server/default/work
   rm -rf /home/baiki/okm/4.1/server/default/log
   su -c "soffice -headless -accept=\"socket,host=127.0.0.1,port=8100;urp;\" -nofirststartwizard" $OKM_USER
   su -l -c "$JBOSS_START_SCRIPT -b 0.0.0.0 > /dev/null 2> /dev/null &" $OKM_USER
   sleep 60
   mount.davfs -o uid=baiki,gid=baiki 192.168.1.222:8080/OpenKM/repository/default/okm\:root/income /home/baiki/transfer/
   $ECHO "Done!"
   )

stop () (
   $ECHO "Stopping OKM (JBoss, davfs2)"
   umount /home/baiki/transfer
   su -l -c "$JBOSS_STOP_SCRIPT -S > /dev/null &" $OKM_USER
   sleep 15
   $ECHO "Done!"
   )

case "$1" in
      start )
            start
            ;;
      stop )
            stop
            ;;
      restart )
            stop
            sleep 30
            start
            ;;
      * )
            $ECHO "Usage: jbossokm {start|stop|restart}"
            exit 1
esac

exit 0
 #5681  by soeme
 
hi guys

i had the script modified, for my environment works fine.

centos with sun jdk 1.6 and Xvfb installed. No Xorg Server installed.
Code: Select all
#! /bin/sh
# /etc/init.d/OpenKM: Start and stop JBoss Application Service with OpenKM

# Set DISPLAY to something besides :1 (because :1 is the standard display). 
DISPLAY=:1000 
ECHO=/bin/echo
TEST=/usr/bin/test
FOLDER=/opt/OpenKM
IP=192.168.1.40
JBOSS_START_SCRIPT=$FOLDER/bin/run.sh
JBOSS_STOP_SCRIPT=$FOLDER/bin/shutdown.sh

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0
$TEST -x $FOLDER || exit 0
$TEST -x /usr/bin/Xvfb || exit 0

start() (
   $ECHO -n "Starting OpenKM"
   rm -rf $FOLDER/server/default/tmp
   rm -rf $FOLDER/server/default/work
   rm -rf $FOLDER/server/default/log
   killall -u `whoami` Xvfb > /dev/null
   Xvfb $DISPLAY -screen 0 800x600x24 > /dev/null 2> /dev/null &
   sleep 2
   soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard --display=:1000  > /dev/null 2> /dev/null &
   sleep 2
   su -c "$JBOSS_START_SCRIPT -b $IP > /var/log/openkm.log &"
   $ECHO "."
   )
stop () (
   $ECHO -n "Stopping JBoss"
   su -c "$JBOSS_STOP_SCRIPT -s $IP  > /dev/null &"
   killall -u `whoami` Xvfb  > /dev/null
   killall -u `whoami` soffice > /dev/null
   $ECHO "."
   )

case "$1" in
      start )
            start
            ;;
      stop )
            stop
            ;;
      restart )
            stop
            sleep 30
            start
            ;;
      * )
            $ECHO "Usage: OpenKM {start|stop|restart}"
            exit 1
esac

exit 0
maybe helpfully for otherones :D
 #6118  by memo
 
I Installed for LINUX SUSE Version 11.3 recently, ad it works fine.
1.Create a text file named jbossokm on directory /etc/rc.d
2. Start Yast ad select System ----> System Services (Run Level)
3. Select Jbossokm and then Enable.
4. OK (The service will be initiated automatically)
5. Check where is yoor JBOSS_START_SCRIPT and JBOSS_STOP_SCRIPT , shuld be teh bin directory of your OpenKM aplication

Luis Amesty

CODE FOR jbossokm:
Code: Select all
#! /bin/sh
# /etc/init.d/jbossokm: Start and stop JBoss Application Service
### BEGIN INIT INFO
# Provides:      OpenKM41
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start:  2 3 5
# Default-Stop:
# Short-Description: Inicia OPENKM Versión 4.1
# Description:    Inicia OPENKM Versión 4.1 Corriendo bajo JBoss4.2.3
### END INIT INFO

ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_START_SCRIPT=/media/datos/OpenKM41/bin/run.sh
JBOSS_STOP_SCRIPT=/media/datos/OpenKM41/bin/shutdown.sh 

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0

start() (
   $ECHO -n "Starting JBoss. Favor espere Toma algo de tiempo  ....."
   $JBOSS_START_SCRIPT -b 0.0.0.0 &
   $ECHO "."
   sleep 20
   )

stop () (
   $ECHO -n "Stopping JBoss"
   $JBOSS_STOP_SCRIPT -S &
   $ECHO "."
   )

case "$1" in
      start )
            start
            ;;
      stop )
            stop
            ;;
      restart )
            stop
            sleep 30
            start
            ;;
      * )
            $ECHO "Usage: jbossokm {start|stop|restart}"
            exit 1
esac

exit 0

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.