Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: ryusuf on April 27, 2022, 10:58:38 AM

Title: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on April 27, 2022, 10:58:38 AM
Dears,

Is there any documentation on setting up services for Genesys Applications like GAX in Linux CentOS 7 which will start automatically on boot?

When we installed LCA, it prompted whether to add in the init.d directory for startup and it created gctilca file inside the directory.

Similarly for config server, i created the following service inside the /etc/systemd/system directory (expecting this is the right approach)

[code][Unit]
Description=Genesys Config Server
After=network.target

[Service]
WorkingDirectory=/app/gcti/config_srv
ExecStart=/app/gcti/config_srv/confserv 2020
Restart=always
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=genesys-confserv
User=root
Group=root

[Install]
WantedBy=multi-user.target[/code]

I want GAX to start once the Linux machine starts up. What is the recommended approach? Is there some kind of service scripts to be added in the init.d or /etc/systemd/system for all the Genesys components?

Let me know your inputs on the best practices.

Best Regards,
Rashid

Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: cavagnaro on April 27, 2022, 11:07:38 AM
No they don't exist by default as Linux tends to vary from flavor to flavor.
Usually that is handled by Linux admins...
But yes, would be nice to have a full library of those.

Enviado de meu SM-N9600 usando o Tapatalk

Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Kubig on April 27, 2022, 11:49:14 AM
Why you do not use the autostart function which SCS provides by default? In that case, you will need only the framework and management being started by OS, rest can be started by Genesys MGMT layer
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on April 28, 2022, 08:55:47 AM
[quote author=Kubig link=topic=12290.msg54825#msg54825 date=1651060154]
Why you do not use the autostart function which SCS provides by default? In that case, you will need only the framework and management being started by OS, rest can be started by Genesys MGMT layer
[/quote]

So does it mean that we need to run gax_startup.sh first and then set the autostart option in the annex of the GAX object. After which, whenever there is a restart of the host, GAX would start automatically?

Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: cavagnaro on April 28, 2022, 05:21:31 PM
You start GAX from GA for example, if it later is detected by SCS as Stopped, will try to start it over.

Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on April 29, 2022, 06:20:14 AM
For GAX I'm using

[code][Unit]
Description=Genesys Administrator Extension Server
After=genesyscs.service

[Service]
EnvironmentFile=/opt/genesys/EnvironmentVariables
Type=forking
PIDFile=/var/run/genesys/genesysgax.pid
User=genesys
Group=genesys
ExecStart=/bin/bash -c "cd /opt/genesys/gax/ ; ./gax_startup.sh & echo $! >/var/run/genesys/genesysgax.pid"
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
[/code]

Local user "genesys" is the owner of /opt/genesys, /var/log/genesys and /var/run/genesys

EnvironmentVariables contains all needed environment like:

[code]JAVA_HOME=/opt/java/jdk11
CASSANDRA_HOME=/opt/cassandra
JRE_HOME=/opt/java/jre11
PATH=/opt/java/jre11/bin:/usr/bin
LD_LIBRARY_PATH=/opt/genesys/SecurityPack:/opt/oracle/instantclient_11_2
LD_LIBRARY_PATH_64=/opt/genesys/SecurityPack
CLASSPATH=/opt/genesys/lib/postgresql-9.3-1104.jdbc4.jar
[/code]

But, yes, you can just set autostart in application Annex:

[code][sml]
autostart=true
[/code]
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on April 29, 2022, 06:21:51 AM
LCA:

[code][Unit]
Description=Genesys Local Control Agent
After=network-online.target nss-user-lookup.target

[Service]
EnvironmentFile=/opt/genesys/EnvironmentVariables
Type=forking
PIDFile=/var/run/genesys/genesyslca.pid
User=genesys
Group=genesys
ExecStart=/bin/bash -c "env > /opt/genesys/env_on_last_lca_launch.log ; cd /opt/genesys/LocalControlAgent/ ; ./run.sh & echo $! >/var/run/genesys/genesyslca.pid"
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
[/code]
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on April 29, 2022, 06:24:24 AM
SCS:

[code][Unit]
Description=Genesys Solution Control Server
After=genesyscs.service

[Service]
Type=forking
PIDFile=/var/run/genesys/genesysscs.pid
User=genesys
Group=genesys
ExecStart=/bin/bash -c "cd /opt/genesys/SolutionControlServer/ ; ./run.sh & echo $! >/var/run/genesys/genesysscs.pid"
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
[/code]
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on April 29, 2022, 07:20:23 AM
Configuration Server:

[code][Unit]
Description=Genesys Configuration Server
After=network-online.target nss-user-lookup.target

[Service]
Type=forking
PIDFile=/var/run/genesys/genesyscs.pid
User=genesys
Group=genesys
ExecStart=/bin/bash -c "cd /opt/genesys/confserv/ ; ./run.sh & echo $! >/var/run/genesys/genesyscs.pid"
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target[/code]
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on April 29, 2022, 07:24:36 AM
Additonal file /etc/tmpfiles.d/genesys.conf that instructs to create directory for PID files at startup:

[code]d    /var/run/genesys  0755 genesys root - -[/code]
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 08, 2022, 07:36:18 AM
[quote author=Janis link=topic=12290.msg54832#msg54832 date=1651213214]

Local user "genesys" is the owner of /opt/genesys, /var/log/genesys and /var/run/genesys


[/quote]

Do you use /var/run/genesys directory to store all the genesys service files? If you can, please elaborate so we can use these practices. :)

Thanks a lot Janis for the details shared. Appreciate it.

Let me try this out and will update.
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 08, 2022, 07:50:22 AM
[quote author=Janis link=topic=12290.msg54834#msg54834 date=1651213464]
SCS:

[code][Unit]
Description=Genesys Solution Control Server
After=genesyscs.service

[Service]
Type=forking
PIDFile=/var/run/genesys/genesysscs.pid
User=genesys
Group=genesys
ExecStart=/bin/bash -c "cd /opt/genesys/SolutionControlServer/ ; ./run.sh & echo $! >/var/run/genesys/genesysscs.pid"
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
[/code]
[/quote]

Under the unit section of this file for SCS, the [b]After [/b]field is [b]genesysscs.service[/b]. Since this file is for SCS itself, should the after field contain genesysscs.service?
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on May 08, 2022, 01:42:44 PM
No, there is genesyscs :) Like GenesysConfigrationService.
But feel free to create your own starting sequence according to your needs.
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 08, 2022, 01:44:45 PM
[quote author=Janis link=topic=12290.msg54871#msg54871 date=1652017364]
No, there is genesyscs :) Like GenesysConfigrationService.
But feel free to create your own starting sequence according to your needs.
[/quote]

Ohhh  :) :) :)

I misread it as scs instead of cs.  :D

Thanks
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 08, 2022, 01:47:12 PM
[quote author=Janis link=topic=12290.msg54871#msg54871 date=1652017364]
No, there is genesyscs :) Like GenesysConfigrationService.
But feel free to create your own starting sequence according to your needs.
[/quote]

What have you done for FlexLM license manager? Can you share your insights.

Thanks in advance
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on May 09, 2022, 07:23:32 AM
FlexLM:
[code][Unit]
Description=Genesys Flex License Daemon
After=network-online.target nss-lookup.target

[Service]
Type=forking
User=genesys
Group=genesys
ExecStart=/opt/genesys/flexlm/lmgrd -c /opt/genesys/flexlm/license.dat -l /var/log/genesys/flexlm/lmgrd.log
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
[/code]
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on May 09, 2022, 07:38:56 AM
[quote author=ryusuf link=topic=12290.msg54868#msg54868 date=1651995378]

Do you use /var/run/genesys directory to store all the genesys service files? If you can, please elaborate so we can use these practices. :)

[/quote]

No, in /var/run/genesys we are getting PID files - small files where process identification numbers of genesys daemons are stored. Systemd likes it.

For systemd unit files (services) I would choose /etc/systemd/system. (https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file)

To be honest, I'm not the greatest Linux expert. Not sure that everything I do is according to best practices. But it is is working ;)
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 09, 2022, 09:13:45 AM
[quote author=Janis link=topic=12290.msg54876#msg54876 date=1652081936]
[quote author=ryusuf link=topic=12290.msg54868#msg54868 date=1651995378]

Do you use /var/run/genesys directory to store all the genesys service files? If you can, please elaborate so we can use these practices. :)

[/quote]

No, in /var/run/genesys we are getting PID files - small files where process identification numbers of genesys daemons are stored. Systemd likes it.

For systemd unit files (services) I would choose /etc/systemd/system. (https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file)

To be honest, I'm not the greatest Linux expert. Not sure that everything I do is according to best practices. But it is is working ;)
[/quote]

Thanks, understood.  :)

The practices shared by you all will help in building the solution in a better way.
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 09, 2022, 09:18:13 AM
[quote author=Janis link=topic=12290.msg54875#msg54875 date=1652081012]
FlexLM:
[code][Unit]
Description=Genesys Flex License Daemon
After=network-online.target nss-lookup.target

[Service]
Type=forking
User=genesys
Group=genesys
ExecStart=/opt/genesys/flexlm/lmgrd -c /opt/genesys/flexlm/license.dat -l /var/log/genesys/flexlm/lmgrd.log
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
[/code]
[/quote]

Thanks, let me try this out.

What i have noticed is that, whenever i start FlexLM from the GAX, it is toggling between STARTED/STOPPED. When i check the processes running for lmgrd, i could see a lot is getting created.

Does it have something to do with autostart configured in the options of FlexLM application object? is there anything additional that needs to be configured in the application object? Or we do not need to control it from autostart option in GAX?
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: Janis on May 09, 2022, 09:22:45 AM
Never had an application object for FlexLM. Just a systemd unit file. Not sure if we can use Management Layer for any third party executable we have.
Title: Re: Service startup for GAX (Other Genesys components etc.) in Linux CentOS 7
Post by: ryusuf on May 09, 2022, 09:41:09 AM
[quote author=Janis link=topic=12290.msg54879#msg54879 date=1652088165]
Never had an application object for FlexLM. Just a systemd unit file. Not sure if we can use Management Layer for any third party executable we have.
[/quote]

Yes we can use Management Layer for third party executable like tomcat, cassandra, flexlm etc.

We have to create an application object of type Third Party Server and fill the command line, arguments and working directory. Under the options, we need to have a section start_stop with the option start_command and stop_command. (In case of Windows Flexlm, i had a start_command with value pointing to flexlm_start.bat file)

Inside the flexlm_start.bat file, i had the following command [b]net start "Flexlm Service" [/b](where Flexlm Service is the name of the Windows Service for Flexlm)

I have done that when using Flexlm in Windows servers.

But don't know, how it works in Linux  :)