Current view: XpoLog V7 (Latest). Available: XpoLog V6 and XpoLog V5

Skip to end of metadata
Go to start of metadata

Another tool to create a service to XpoLog beside systemctl is the init.d utility.
Init.d is more common and old feature on linux servers, and it enables configuring the service with control about its status after a restart of the machine or after the automatic recycle mechanism of XpoLog.

 

RHEL / AWS Linux AMI

In order to configure such a service, you have to perform the following steps:

  1. With user root, create a file with the name 'xpolog' under /etc/init.d.

  2. Edit the file and add set its contents to:

    #!/bin/bash

    # chkconfig: 2345 20 80

    # description: XpoLog Center init script

    # Source function library.

    . /etc/init.d/functions

    start() {

            cd [XPOLOG_INSTALLATION_DIR]

            sudo sh runXpoLog.sh start

    }

    stop() {

            cd [XPOLOG_INSTALLATION_DIR]

            sudo sh runXpoLog.sh stop

    }

    case "$1" in

        start)

           start

           ;;

        stop)

           stop

           ;;

        restart)

           stop

           start

           ;;

        status)

            cd [XPOLOG_INSTALLATION_DIR]

            sudo sh runXpoLog.sh stat

            ;;

        *)

           echo "Usage: $0 {start|stop|status|restart}"

    esac

    exit 0

  3. Grant an execution permission on the file with the command: chmod +x /etc/init.d/xpolog

      4. Ensure that the service is recognized by the chkconfig utility with the command: chkconfig --add xpolog

      

    The command by which you can control the service is: service xpolog start/stop/restart/status

    In order to verify that the service was configured properly, you can run all this commands and ensure that each one of them performs as expected.

Example to a xpolog service file: xpolog

 

Ubuntu / CentOS

  1. With user root, create a file with the name 'xpolog' under /etc/init.d.

  2. Edit the file contents to:

#! /bin/sh
### BEGIN INIT INFO
# Provides: xpolog
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: XpoLog
# Description: This file starts and stops XpoLog server
#
### END INIT INFO

case "$1" in
start)
cd /opt/XpoLogCenter/
sh runXpoLog.sh start
;;
stop)
cd /opt/XpoLogCenter/
sh runXpoLog.sh stop
;;
restart)
cd /opt/XpoLogCenter/
sh runXpoLog.sh stop
sh runXpoLog.sh start
;;
status)
cd /opt/XpoLogCenter/
sh runXpoLog.sh stat
;;
*)
echo "Usage: xpolog {start|stop|restart|status}" >&2
exit 3
;;
esac

3. Grant an execution permission on the file with the command: chmod +x /etc/init.d/xpolog

4. Ensure that the service is recognized by the chkconfig mechanism with the command: chkconfig --add xpolog

 In order to verify that the service was configured properly, you can run all this commands and ensure that each one of them performs as expected.

 

 

  • No labels