NOTE: Please, refer to XTM file tree and locations for comprehensive information regarding file tree, folders and important xtm app's data!

STARTUP – Below is a proper starting order of xtm application:

  1. Login as user xtm:

    From root account please do the following:

    su xtm

    To be able to log in from different accounts, you will have to configure sudo mechanism for a given user, so it can log into xtm user.

  2. Run this command while being logged in as user xtm: (I assume that xtm is installed in a standard location, if not, edit path accordingly)

    /xtm/start.sh

    This script starts the application and it can take a few minutes for proper launch, so after a while please check logs and the service itself to confirm that it's working (those commands work from xtm user):

    systemctl status xtm-cat.service;systemctl status xtm-pm.service;systemctl status xtm-spell.service
    tailf /servers/all_logs/*

SHUTDOWN – The shutdown should be made in such order:

  1. Log in as user xtm – look (figure 1 in starting section)
  2. Run this command while being logged in as user xtm: (I assume that xtm is installed in a standard location, if not, edit path accordingly)

    /xtm/stop.sh

    Verify that app has stopped properly:

    systemctl status xtm-cat.service;systemctl status xtm-pm.service;systemctl status xtm-spell.service
    tailf /servers/all_logs/*
  3. After proper stopping of the app itself, we need to shutdown workbench, as it's running using websockets. Make an executable bash script (if you don't know how to, check the section "Second" in this document: Free disk space very low )
    Paste into your file (e.g. wb_shutdown.sh):

    #!/bin/bash
    #
    # wbcat - tomcat with workbench
    # wbserverport - local server address and port of workbench
     
    # find tomcat with workbench
    #wbcat=$(ls -l /servers/*/webapps | grep workbench)
    wbcat=$(find /servers/*/webapps -name "workbench")
    wbcat=$(echo $wbcat | cut -c10- | rev | cut -c19- | rev)
    #find local server address and workbench pooooort
    wbserverport=$(cat /xtm/xtm/confs/xtm-paths-conf.xml | grep "workbench-local-server-address" | cut -c48- | rev | cut -c4- | rev)
    if !($webserverport)
    then
    #if there is no info about workbench in /xtm-paths-conf.xml set default address and port
    wbserverport='localhost:8080'
    echo "default workbench server address"
    fi
    echo "Tomcat with workbench:"
    echo $wbcat
    echo "Workbench server:port"
    echo $wbserverport
     
    TOKEN=`curl -s -H "Content-Type: application/x-www-form-urlencoded" -X POST $wbserverport/workbench/oauth/token -d 'grant_type=client_credentials' -u '4bigH0rse:twx9dFZ9xXK-T7iu' |awk -F'"' '{ $1 == "access_token" } { print $4 }'` ; sleep 2 ; curl -i -H 'Authorization: Bearer '$TOKEN'' -X GET $wbserverport/workbench/internal-api/shutdown?password=sec\!pass
     
    sleep 15
    echo "Workbench shutting down ..."
    cat /servers/$wbcat/logs/catalina.out | grep com.xtm.workbench.superiors.shutdown.WorkbenchShutdownProcessor

    And run this script. The workbench should be now closed.

RESTART – To restart the application, first iterate over all steps in the "Shutdown" section, then start the application as shown in "Startup" section.

TROUBLESHOOTING – what to do when there are some issues:

  1. The application was run by a different user (mainly as a root):

    Generally, the application should be run by a xtm user. If by accident, it was run by a root, then in many cases, the ownership of many app's files was changed to root. To fix this, the full shutdown should be made from a root account as described above, and then there will need to change ownership of files in xtm application (run this from root account):

    chown -R xtm:xtm /xtm

    This is very likely to happen if you have an operating system not using systemd (e.g. CentOS 6.X) – as new versions of xtm application use systemd to control the service and run them from xtm user, but bear in mind, it can even happen if you have modern OS.a 

  2. Application was run from /servers/cat/bin/start.sh instead of /xtm/start.sh:

    The application should always be started from /xtm/start.sh , in case we did start it from this location, we need to check if it was run by an xtm user, if yes, there shouldn't be any problems, but in case of running this as a different user, please do steps shown in "Application was run by a different user (mainly as a root)"

  3. The application was closed, but without the workbench:

    Workbench runs using websockets, and is not connected to the main app in terms of closing the app itself. If the application was stopped, then run again, without stopping workbench, there may be some issues. In such a case, please do once again a full shutdown as described in "SHUTDOWN" section then verify that app and workbench are not running anymore. After proper startup ("STARTUP" section in this article) there should be proper functioning of both modules, but bear in mind, that some of the work in workbench may be lost due to improper shutdown.

RESTARTING INDIVIDUAL SERVICES OR 'PROCESSING':

  1. Log into user xtm and then you can restart each separate service using commands shown below:

    sudo systemctl restart xtm-spell.service
    sudo systemctl restart xtm-pm.service
    sudo systemctl restart xtm-cat.service

    Note, that this is mainly used when a restart of processing is needed, running them without a reason may result in losing your projects' progress.