Managing Services

From KnowledgeTree Community

Jump to: navigation, search

This wiki article details how to start and stop KnowledgeTree services for different versions of KnowledgeTree.

KnowledgeTree also depends on the Apache or IIS, and MySQL services, as well as 3rd party services. The following instructions describe how to activate the core services only.

Contents

KnowledgeTree 3.7 Community Edition Release Candidate

KnowledgeTree 3.7 provides start up scripts for services on both Windows and Linux.

Windows

Starting services

1) Open Command Prompt;

2) Browse to the KnowledgeTree directory. (Default is C:\Program Files\Zend\knowledgetree)

3) Run the following command

> dmsctl.bat start

Stopping services

1) Open Command Prompt;

2) Browse to the KnowledgeTree directory. (Default is C:\Program Files\Zend\knowledgetree)

3) Run the following command

> dmsctl.bat stop

Linux

Starting services

1) Open the terminal;

2) Browse to the KnowledgeTree directory. (Default is /usr/share/knowledgetree-ce)

3) Run the following command

$ ./dmsctl.sh start

Stopping services

1) Open the terminal

2) Browse to the KnowledgeTree directory (Default is /usr/share/knowledgetree-ce)

3) Run the following command

$ dmsctl.sh stop

Configure services to start automatically on restart

1) Edit the knowledgetree.sh file

cat | sudo tee /etc/init.d/knowledgetree > /dev/null << EOFile
#!/bin/bash
### BEGIN INIT INFO
# Provides:          knowledgetree
# Required-Start:    $local_fs $remote_fs $syslog $named $network $time
# Required-Stop:     $local_fs $remote_fs $syslog $named $network
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/Stop the KnowledgeTree services
### END INIT INFO


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/share/knowledgetree-ce/dmsctl.sh
NAME=knowledgetree
DESC=knowledgetree

test -x $DAEMON || exit 0

if ! [ -x "/lib/lsb/init-functions" ]; then
        . /lib/lsb/init-functions
else
        echo "E: /lib/lsb/init-functions not found, lsb-base (>= 3.0-6) needed"
        exit 1
fi

set -e

case "$1" in
  start)
        log_daemon_msg "Starting $DESC" "$NAME"
        $DAEMON start
        log_end_msg $?
        ;;
  stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        $DAEMON stop
        log_end_msg $?
        ;;
  restart)
        $0 stop
        sleep 1
        $0 start
        ;;
  *)
        log_failure_msg "Usage: $N {start|stop|restart|reload|force-reload}" 
        exit 1
        ;;
esac

exit 0
EOFile


2) Make it executable:

sudo chmod +x /etc/init.d/knowledgetree

3) Add it to startup

sudo update-rc.d knowledgetree defaults

4) Stop/Start the services running:

sudo invoke-rc.d knowledgetree stop
sudo invoke-rc.d knowledgetree start

Older versions of KnowledgeTree

Please see the KnowledgeTree Administration Manual

Personal tools