Install a Component as a Service on Linux

On Linux operating systems, you can install a component as a service to allow you to easily start and stop it. You can also configure the service to run when the machine boots. The following procedures describe how to install License Server as a service on Linux.

NOTE: To use these procedures, you must have root permissions.

The procedure that you must use depends on the init system.

  • For Linux operating systems that use systemd, see systemd.
  • For Linux operating systems that use System V, see System V.

systemd

NOTE: If your setup has an externally mounted drive that License Server uses, you might need to modify the init script. The installed init script contains examples for an NFS mount requirement.

To install a component as a service

  1. Navigate to the init/systemd directory, in the component installation folder.
  2. Open the service configuration file and fill in the placeholder values. For more information about these placeholders, refer to the file readme.md in the init directory.
  3. Run the appropriate command to copy the service configuration file to the appropriate directory.

    • Red Hat Enterprise Linux (and CentOS)

      cp InstallDir/init/systemd/componentname.service /etc/systemd/system/componentname.service
    • Debian (including Ubuntu):

      cp InstallDir/init/systemd/componentname.service /lib/systemd/system/componentname.service

    where componentname is the name of the service configuration file that you want to use, which is the name of the component executable (without the file extension).

    For other Linux environments, refer to the operating system documentation.

  4. Run the following commands to set the appropriate access, owner, and group permissions for the component:

    • Red Hat Enterprise Linux (and CentOS)

      chmod 755 /etc/systemd/system/componentname.service
      chown root /etc/systemd/system/componentname.service
      chgrp root /etc/systemd/system/componentname.service
    • Debian (including Ubuntu):

      chmod 755 /lib/systemd/system/componentname.service
      chown root /lib/systemd/system/componentname.service
      chgrp root /lib/systemd/system/componentname.service

    where componentname is the name of the component executable that you want to run (without the file extension).

    For other Linux environments, refer to the operating system documentation.

  5. (Optional) If you want to start the component when the machine boots, run the following command:

    systemctl enable componentname

TIP: On systemd systems, services do not inherit file handle limits from the system limits or user settings. The default limits for services are configured separately in /*/systemd/system.conf and /*/systemd/user.conf.

In some cases this behavior might mean that a component fails to operate because it runs out of file handles. In this case, you can modify the LimitNOFILE parameter in the componentname.service file to increase the file handle limit before you install the service. Alternatively, you can create an override.conf file for the service.

System V

To install a component as a service

  1. Navigate to the init/systemv directory, in the component installation folder.
  2. Open the init script and fill in the placeholder values. For more information about these placeholders, refer to the file readme.md in the init directory.
  3. Run the following command to copy the init scripts to your init.d directory.

    cp InstallDir/init/systemv/componentname /etc/init.d/

    where componentname is the name of the init script that you want to use, which is the name of the component executable (without the file extension).

  4. Run the following commands to set the appropriate access, owner, and group permissions for the component:

    chmod 755 /etc/init.d/componentname
    chown root /etc/init.d/componentname
    chgrp root /etc/init.d/componentname
  5. (Optional) If you want to start the component when the machine boots, run the appropriate command for your Linux operating system environment:

    • Red Hat Enterprise Linux (and CentOS):

      chkconfig --add componentname
      chkconfig componentname on
    • Debian (including Ubuntu):

      update-rc.d componentname defaults

    For other Linux environments, refer to the operating system documentation.