logo
Powered by QM on a Rpi server
Home
About OpenQM
Sales and Downloads
Help and Support
About
  Privacy Policy
  Contact Us
  Partners
  Services
  Applications
Login

KnowledgeBase 00059: System Startup Scripts

Last updated: 17 Feb 2017
Applies to: All versions
Search  
Top level index       Full Index Search Tips
Previous article     Next article

This article was originally published as a Tip of the Week.

QM provides a facility whereby one or more commands can be executed automatically when QM is started. This is typically used to launch phantom processes that must be present at all times.


The STARTUP Configuration Parameter

The QM configuration parameters file may contain lines of the form

   STARTUP=command
For each such line, QM will execute the command as part of the startup sequence. Where multiple STARTUP parameters are present, the order in which they run is not guaranteed.

By default, the command is executed in the QMSYS account and as the SYSTEM user on Windows or as root on Linux. This may be undesireable, giving the process too great an access level. The STARTUP parameter can be extended to be

   STARTUP=command; account username password
in which case the command is executed in the named account and as the specified user.

A process started by STARTUP will have the @TTY system variable set to "startup". This can be tested in paragraphs (e.g. the LOGIN paragraph) by a command such as

   IF  = 'startup' THEN STOP 


Improving Security

Because the QM configuration parameters file is usually readable by all users, it is not a good idea to include a plain text password in the STARTUP parameter. Instead, the password can be encrypted using the AUTHKEY command and the encrypted form prefixed with ENCR: used in the STARTUP parameter.


Persistent Processes

If the command executed by the STARTUP parameter will run for a long time, it may be best to use STARTUP to launch a phantom process.

   STARTUP=PHANTOM command; account username password


Related Articles

None.



Please tell us if this article was helpful
Very     Slightly     Not at all
Comments
Email (optional)