Appendix A: Manually Installing the Agent as a Windows Service

After the Agent is installed, it is possible to manually register or unregister the Agent as a Windows service.

  • To unregister the service:

    Execute ALM_HOME/daemons/agent/karaf/bin/karaf-service.bat with argument remove.

  • To register the service:

    Execute ALM_HOME/daemons/agent/karaf/bin/karaf-service.bat with argument install.

If you want to reconfigure the service, edit the file ALM_HOME/daemons/agent/karaf/etc/karaf-wrapper.conf.

For example, you can change the amount of memory the Agent VM can use (in MB) by changing: `wrapper.java.maxmemory = 512 `

It is generally not recommended to change any of the other properties in the karaf-wrapper.conf file, as it may cause the Agent to stop working.

For more information on the configuration file, refer to:

Appendix B: Manually Installing the Agent as a Daemon Process on Linux/Unix Systems

The IKAN ALM installer does not automatically install the IKAN ALM Agent as a Linux/Unix daemon. These steps must be performed after installation.

Since the ALM Server uses Apache Karaf as the OSGi runtime environment, this basically comes down to using the Apache Karaf Wrapper feature (see the Karaf 4.0 manual: https://karaf.apache.org/manual/latest/#_service_wrapper

As an example, we will describe this procedure for installing and removing the ALM Agent as a service on a CentOS Linux.

  1. If you are currently running the IKAN ALM Agent, stop it by executing ALM_HOME/daemons/agent/stopAgent.sh.

  2. Launch the IKAN ALM Agent Karaf by executing ALM_HOME/daemons/agent/karaf/bin/karaf_agent.sh.

    This will launch the IKAN ALM Agent with the Karaf console enabled, which we will need to use the Karaf Wrapper feature.

  3. After the start up messages have finished, press <enter> and you will see the Karaf console prompt: "karaf@root>".

  4. In the Karaf console, execute "feature:install wrapper".

    This will install the Karaf Wrapper feature.

    You can verify that this worked by executing " feature:list | grep wrapper".

    This should give the output: wrapper | 4.0.7 | x | Started | standard-4.0.7 | Provide OS integration[.

  5. Now we must call "wrapper:install" which will generate the necessary files to install the IKAN ALM Agent as a Linux service.

    In the Karaf console, execute 'wrapper:install -s DEMAND_START -n almagent58 -d "IKAN ALM 5.8 Agent" -D "IKAN ALM 5.8 Agent Daemon"'.

    When this command succeeds, it conveniently reports the commands that we need to execute as subsequent steps.

  6. Shut down the IKAN ALM Agent Karaf.

    In the Karaf console, execute "shutdown -f".

  7. Adapt the ALM_HOME/daemons/agent/karaf/etc/almagent58-wrapper.conf file that was created, by adding the following options:

    • Just before the KARAF_HOME, in the section of the general wrapper properties, set the path to the Java runtime you selected during the IKAN ALM Agent installation:

      set.default.JAVA_HOME=/opt/java/jdk1.8

    • Change the path to the java executable:

      wrapper.java.command=/opt/java/jdk1.8/bin/java

    • In the section of the JVM Parameters, add following parameters:

      wrapper.java.additional.10=-XX:+UnlockDiagnosticVMOptions

      wrapper.java.additional.11=-XX:+UnsyncloadClass

  8. At this point, everything is configured, so we can install, remove, stop and start the IKAN ALM Agent Linux daemon.

    All of these commands need administrative privileges, so you will need to execute them with "sudo".

    • To install the service:

      ln -s /home/ikan/ALM/daemons/agent/karaf/bin/almagent58-service /etc/init.d/

      chkconfig almagent58-service –add

    • To start the service when the machine is rebooted:

      chkconfig almagent58-service on

    • To disable starting the service when the machine is rebooted:

      chkconfig almagent58-service off

    • To start the service:

      service almagent58-service start

    • To stop the service:

      service almagent58-service stop

    • To uninstall the service:

      chkconfig almagent58-service --del

      rm /etc/init.d/almagent58-service