Genesys Engage on-premises

 View Only
Discussion Thread View
  • 1.  How to autostrart configserver in linux after server reboot

    Posted 08-10-2019 16:12
    Hello All

    In Cent OS 7.5, how to make config server to start automatically after server reboot.
    #PlatformAdministration

    ------------------------------
    Regards
    Mohammed Anees
    ------------------------------


  • 2.  RE: How to autostrart configserver in linux after server reboot

    GENESYS
    Posted 08-11-2019 02:57
    Here is the procedure to create an configserver service and make it auto-start on boot in RHEL or CentOS

    1. Create the service for confserv (confserv.service) (Name it as per your environment standard).
    # vi /etc/systemd/system/confserv.service

    2. Hit "Insert" and paste the below content in to the confserv.service file.
    ------------------------------------------------------------------------------------
    [unit]
    Description=Script to start the confserv
    [Service]
    User=genesys
    Type=simple
    WorkingDirectory=/opt/apps/gcti/confserv
    ExecStart=/bin/bash /opt/apps/gcti/confserv/run.sh
    Requires=lca.service flexlm.service
    After=lca.service flexlm.service
    [Install]
    WantedBy=default.target
    ------------------------------------------------------------------------------------
    Where:
    User - This will be the user using which the service will be started. Provide the username which is authorized for Genesys applications.
    WorkingDirectory - the actual directory where your configserver is installed.
    ExecStart - The application executable path. Here a prefix of /bin/bash is required because the executable is a bash script file.
    The "Requires" and "After" definies dependancies to start confserv.service file on boot. The above service file will execute the /opt/apps/gcti/confserv/run.sh command only after lca.service and flexlm.service has started. Assuming lca.service and flexlm.service is already created the same way and available in /etc/systemd/system/. If you do not want to add a dependancies to confserv.service then you may exclude the "Requires" and "After" lines.

    Note: If you have any environment variable dependancies, then please add one more line as below
    Environment = "<variable>=<value>"
    Example: Environment = "NLS_LANG = en_US.UTF8"

    3. Hit ESC key followed by ":wq" to write and quit the confserv.service file.

    4. Provide execute permission to confserv.service file.
    # chmod +x confserv.service


    5. Now run the below command to reload confserv.service file so the modifications are applied. You will have to run the below command every time you modify any .service file.
    # systemctl daemon-reload

    6. Enable the confserv.service to run on system bootup.
    # systemctl enable confserv.service

    7. Start the service
    # systemctl start confserv.service

    8. Finally reboot the host and check if the service is automatically running on boot.
    # systemctl reboot

    ------------------------------
    Vinod Balan
    Reporting & Analytics
    Genesys - Employees
    ------------------------------



  • 3.  RE: How to autostrart configserver in linux after server reboot

    Posted 12-07-2021 11:07
    Hello Vinod Balan,

    I have installed only one stat server and starting multiple instance with different name  -app "StatServer_1", "StatServer_2" ......."StatServer_N" in this case how to write a service file.

    Stat server Installed path /opt/gcti/StatServer_1

    Server Info: StatServer_1
    ====================
    Working Directory:
    /opt/gcti/StatServer_1/Current
    Command line:
    ./statserv
    Command Line Arguments:
    -host lx70305 -port 2020 -app "StatServer_1"

    Server Info: StatServer_2
    ====================
    Working Directory:
    /opt/gcti/StatServer_1/Current
    Command line:
    ./statserv
    Command Line Arguments:
    -host lx70305 -port 2020 -app "StatServer_2"
    .
    .
    .
    .
    .
    .
    Server Info: StatServer_N
    ====================
    Working Directory:
    /opt/gcti/StatServer_1/Current
    Command line:
    ./statserv
    Command Line Arguments:
    -host lx70305 -port 2020 -app "StatServer_N"

    ------------------------------
    Lakshmanakumar Krishnasamy
    Infosys Limited
    ------------------------------



  • 4.  RE: How to autostrart configserver in linux after server reboot

    GENESYS
    Posted 12-08-2021 06:31
    Hello Lakshman,

    You can create a service file template by using the "@" in the service file name, like Statserver@.service. Your Statserver@.service should look like below for this to work.
    [Unit]
    Description=Script to start %I
    After=network.target
    
    [Service]
    Type=simple
    User=genesys
    WorkingDirectory=/opt/gcti/StatServer_1/Current
    ExecStart=/opt/gcti/StatServer_1/Current/statserv -host lx70305 -port 2020 -app %I
    
    [Install]
    WantedBy=default.target​


    Use systemctl commands like below.

    To start the service as StatServer_1:
    ​systemctl start Statserver@Statserver_1

    To start the service as StatServer_2:

    ​systemctl start Statserver@Statserver_2

    To start the service as StatServer_N:
    ​systemctl start Statserver@Statserver_N

    To stop or check status of these instances you cannot simply run ​"systemctl start Statserver@.service". You will have to use the right parameter (respective app name) like below (example for Statserver_1 instance).
    ​systemctl status Statserver@Statserver_1
    ​systemctl stop Statserver@Statserver_1

    There is only one Statserver@.service file created. The value you pass after @ in Statserver@<Parameter> , will be captured in the places of %I inside the service file. Each of the instances will run as individual service.
    As long as you have ​Statserver_1, Statserver_2 .. Statserver_N application objects created in CME/GA/GAX, each of these instances will run and GA/GAX will show the respective application as started.

    Risky business:
    During my test, I was able to run multiple statserver instances against different application names all at the same time, of course running on different ports. This could be risky in a production environment as all those instances use the same installation files. I believe this kind of setup hasn't been tested.
    If you are using the same installation directory to run one application at a time, I see no problems with the above approach. However, please be cautious if you are running multiple instances of the same statserver executable.


    ------------------------------
    Vinod Balan
    Genesys - Employees
    ------------------------------