Page 1 of 1

OpenKM failed to start from script

PostPosted:Sat Oct 10, 2015 6:30 am
by hariharan.gopal
Hi,

I used this below script:
Code: Select all
#!/bin/sh
 
### BEGIN INIT INFO
# Provides:          jboss
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop JBoss AS
# Description:       Enable JBoss AS service provided by daemon.
### END INIT INFO
 
ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_USER=openkm
JBOSS_IP=127.0.0.1
JBOSS_HOME=/home/openkm/jboss-4.2.3.GA
JBOSS_START_SCRIPT=$JBOSS_HOME/bin/run.sh
JBOSS_STOP_SCRIPT=$JBOSS_HOME/bin/shutdown.sh
 
$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0
 
start() {
    $ECHO -n "Starting JBoss"
    su - $JBOSS_USER -c "$JBOSS_START_SCRIPT -b $JBOSS_IP > /dev/null &"
    $ECHO "."
}
 
stop() {
    $ECHO -n "Stopping JBoss"
    su - $JBOSS_USER -c "$JBOSS_STOP_SCRIPT -s $JBOSS_IP > /dev/null &"
    while [ "$(ps -fu $JBOSS_USER | grep java | grep jboss | wc -l)" -gt "0" ]; do
        sleep 5; $ECHO -n "."
    done
    $ECHO "."
}
 
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        sleep 30
        start
        ;;
    *)
        $ECHO "Usage: jboss {start|stop|restart}"
        exit 1
esac
exit 0
Made it executable using:
Code: Select all
$ sudo chmod 755 /etc/init.d/jbossokm
$ sudo update-rc.d jbossokm defaults
But I am getting the below error:
Code: Select all
$ sudo service jbossokm status
Code: Select all
jbossokm.service - LSB: Start and stop JBoss AS
   Loaded: loaded (/etc/init.d/jbossokm)
   Active: failed (Result: exit-code) since Sat 2015-10-10 11:53:48 IST; 1min 32s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 628 ExecStart=/etc/init.d/jbossokm start (code=exited, status=203/EXEC)

Oct 10 11:53:48 BackUp systemd[1]: Starting LSB: Start and stop JBoss AS...
Oct 10 11:53:48 BackUp systemd[1]: jbossokm.service: control process exited, code=exited status=203
Oct 10 11:53:48 BackUp systemd[1]: Failed to start LSB: Start and stop JBoss AS.
Oct 10 11:53:48 BackUp systemd[1]: Unit jbossokm.service entered failed state.
Oct 10 11:53:48 BackUp systemd[1]: jbossokm.service failed.

So could you please guide me on this.

Thanks in Advance.

Re: OpenKM failed to start from script

PostPosted:Sat Oct 10, 2015 4:01 pm
by jllort
This is an old script for starting stopping older openkm ( version 5.x or older with jboss ). Which openkm version are you using ( for newer version you should use http://wiki.openkm.com/index.php/Config ... vice_linux )

Re: OpenKM failed to start from script

PostPosted:Mon Oct 12, 2015 11:22 am
by hariharan.gopal
Hi,

I am using OpenKM 5.1.8.

Re: OpenKM failed to start from script

PostPosted:Tue Oct 13, 2015 7:43 am
by jllort
This is a very old OpenKM version and we consider as "deprecated" we encourage upgrading to lastest 6.3

The older wiki section about jboss service is http://wiki.openkm.com/index.php/Config ... ss_service which is your linux distro ? because not on all distributions is registered in same way a service.