EEM & igatewag on Redhat 7.2

Blog Post created by a_cooper on Sep 1, 2017

When installing EEM (from the CCS DVD of autosys suite) it installs several other components and 2 services being "CA directory services (dxserver) and iTechnology (igateway).  The install works and everything seems fine BUT under the surface is a problem due to the change from sysVinit to systemd for the OS.  Both dxserver and igateway are written for sysVinit (Redhat 6.x and below) but are running in a systemd (Redhat 7.x) environment.


First so background about how systemd is backwardly compatible with sysVinit.  When systemd starts it build a set of service unit files (/run/systemd/generator.late) from the start/stop scripts in the /etc/rc.d/init.d directory.  It then uses the link/file names in the /etc/rc.d/rc?.d directories to update these generated files with the automatic startup and shutdown criteria.  The matching of the links for the start/stop is done on name to the start/stop script.  Also this means that when you run the command "service start igatewayd" it actually redirects to systemctl and uses the auto generated service unit file, just as if you enters the command "systemctl igatewayd start".


For the dxserver service everything works as expected as all the sysVinit components/files are configured in the "standard practices" way, however for igateway this is not the case and hence it does not work as perhaps expected.


First igateway has 2 start/stop scripts, one in the install directory (/opt/CA/SharedComponents/iTechnology by default) and a copy in the standard /etc/rc.d/init.d directory.  As they are a copy of each other they will behave the same but if changes are made to one and not the other then you may see differences in behaviour between sysVinit and systemd behaviour.  Secondly the soft links created in the /etc/rc.d/rc?.d directories link to the file in the install directory and have the naming format K??igateway/S??igateway, while the start/stop script in the /etc/rc.d/init.d directory is called igatewayd.


What this means is that under sysV (Redhat 6.x) when the system started the script in the install directory was run, but if a manual command "service stop igatewayd" was used then the script in the init.d directory was used, which is why most of the CA docs for igateway refer to using the script in the install directory to start/stop the service.


Now under systemd (Redhat 7.x) the system always uses the script in the init.d directory, and as the init.d file is called igatewayd the service unit file is defined for igatewayd.service (NOT igateway) but the links are for ???igateway and so the auto generator does not build the start/stop definitions in the igatewayd service file and hence igateway will not auto start on system boot.


So what to do?  The options are:

1. rename the rc?.d links

2. rename the init.d file

3. create a systemd service unit file for the igateway service.


Renaming the rc?.d links from ???igateway to ???igatewayd means that the igatewayd service will auto start on system start, but the script being run still the one in the init.d directory (regardless of where the links point to). Could create a link from the init.d to install directory but this is definitely not best practice at the OS level.  Could create link from install directory to the init.d directory but this could be removed on an update/patch


Renaming the init.d file from igatewayd to igateway means that the igateway service will autostart on system start, but the script being run is again the one in the init.d directory.


The solution that we went for was to create a systemd service file (/etc/systemd/service/igatewayd.service) which uses the start/stop script in the install directory, remove all the rc?.d links so we did not get confused about how it was starting (but this is strictly not necessary), and left the file in the init.d directory as a marker, but it could be removed as it is no-longer required under the systemd management environment.


After placing the attached file or creating your own service unit file in the /etc/systemd/service directory don't forget to set its context (for SELinux) and enable it for systemd to add it into the auto start processing with:

#> chcon -u system_u /etc/systemd/system/igatewayd.service

#> systemctl enable igatewayd


Let me know what you think or any questions about what we have done here


rhel 7.x red hat 7 igateway ca embedded entitlements manager (eem) eem configuring eem