I was getting intimate with the latest(11.1.2.1.0) version of Oracle API Gateway aka OAG pka Oracle Enterprise Gateway aka OEG and ran into a speed bump.
In my case, I was automating the installation process and needed to register the gateway and node manager as services. Here are the given options(among the others) for accomplishing this in a silent install:
--askNmService Add a Service (/etc/init.d script) for the Node Manager?
Default: 0
--nmServiceUser Username
Default: admin
--nmServiceUserQuestion Run Service as non default user?
Default: 0
--askGwService Add a Service (/etc/init.d script) for the API Gateway Instance?
Default: 0
--gwServiceUser Username
Default: admin
--gwServiceUserQuestion Run Service as non default user?
Default: 0
Given this post’s title, it may come as no surprise that using these flags is not the way to go. There seems to be a few leftover references to the previous version’s file structure. Here’s the fix. First, install the product without configuring these options.
Change directory to /apigateway/posix/samples/etc/init.d
Notice that they’ve changed the name of the init script “apigateway” to match the new name. Unfortunately, the installation binary is still looking for “enterprisegateway”. No biggie. As root,
cp apigateway /etc/init.d
cp nodemanager /etc/init.d
Change directory over to /etc/init.d and open the newly copied nodemanager file for editing. Underneath the ‘INIT INFO’ box, you’ll want to set these variables:
PRODUCT_DESC="Node Manager"
VINSTDIR=""
VDISTDIR="[root software dir]/apigateway"
USER="[linux user]"
Save and close the file. Now open the apigateway file for editing. Set these variables:
PRODUCT_DESC="Oracle API Gateway"
VINSTDIR="[root software dir]/apigateway/groups/group-2/instance-1"
VDISTDIR="[root software dir]/apigateway"
USER="[linux user]"
Note that ‘group-2’ and ‘instance-1’ may vary as per your installation and clustering settings.
Next set permissions and register the services
chown root:root apigateway nodemanager
chmod 755 apigateway nodemanager
chkconfig nodemanager on
chkconfig apigateway on
Now these will execute on startup!