StarQuest Technical Documents

StarLicense/UNIX: Using a non-root user

Last Update: 13 December 2019
Product: StarLicense
Version: 1.2 or later
Article ID: SQV00SL008

Abstract

The default installation of StarLicense Server for UNIX assumes that the root user will be used for configuration and by the service. This technical document describes how to run the StarLicense Server on UNIX as a user other than root.

The examples below assume you are using Linux, where the default installation location is /usr/share/starlicense.

It is not necessary to change ownership of the installed files in /usr/share/starlicense, though it may make it easier to make the script changes described below.

Note that these script changes will have to be repeated after an update of the StarLicense product. We recommend saving a backup copy of your modified scripts before updating StarLicense.

This method has been tested on RedHat/CentOS 7.x. The syntax of the runuser command varies between Linux versions and may need to be adjusted. Also, confirm that the runuser command is in the PATH of the root user, or supply the full path to runuser (e.g. /sbin/runuser) in the script change below.

Solution

  • As root, Install the product as usual to its default location (e.g. /usr/share/starlicense on Linux)
  • As root, run the configure script to add your license key and configure listeners and client-server connections. These operations create or modify /etc/starlicense.rc and require write access to the /etc directory.
  • Edit the following shell scripts in /usr/share/starlicense.

configure - change:
${STARLICENSE}/sqlicd &
to
${STARLICENSE}/sqlicd -R &

sqlicd.sh - change:
SQLICD=${STARLICENSE}/sqlicd
to:
RUNASUSER=<myuser>
SQLICD="runuser -u $RUNASUSER -- ${STARLICENSE}/sqlicd -R"

Also add a rm statement to the 'stop') case:

'stop')
  kill -TERM `cat $STARLICPIDPATH/starlic.pid`
  rm -f $STARLICPIDPATH/starlic.pid
;;

# /sbin/chkconfig --add sqlicd

  • As your non-root user, you can use configure -R to run the configure script for other functions such as starting and stopping the service or displaying the configuration.
  • As your non-root user, you will not be able to use sqlicd.sh start since runuser may not be used by non-root users. If you need to start the service manually as your non-root user, either use the configure script, or make a copy of sqlicd.sh and change the setting of SQLICD to:
    SQLICD=${STARLICENSE}/sqlicd -R



 


DISCLAIMER

The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization.  The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.