Environment variables are values that are injected into a program's runtime environment when it is first started.


In FireDaemon Pro, environment variables are set up using the Environment tab on the New / Edit Service Definition dialog box. Refer to Environment Tab


Environment variables can also be created for the system and/or the user via the Windows Environment Variables dialog window. To access this:

  1. Using the mouse, right-click on the Windows My Computer / This PC desktop icon and select the Properties menu option.
  2. On the System Properties dialog, select the Advanced tab, and then click the Environment Variables button in the lower right corner.



Environment variables can be created, edited or deleted accordingly.



In FireDaemon Pro, any environment variables set on the Environment tab always override the Windows user and system environment variables. The environment variables defined for the FireDaemon Pro service are also expanded in the context of the service’s user account.


FireDaemon Environment Variables


FireDaemon Pro automatically provides a set of standard FD environment variables to each FireDaemon Pro service and also to any Launch and Termination Event programs. These are listed below.


The FD environment variables are expanded by enclosing the variable name in percentage signs, e.g. %FDServiceShortName%.


The FD environment variables can also be used in a service's debug log file path to facilitate implicit log rolling (see About Log Rolling)


By default, the values of the FDServiceExecutable, FDServiceWorkDir, and FDServiceParameters environment variables are automatically expanded.


VariableDescription
FDServiceShortNameService short name
FDServiceDisplayNameService display name
FDServiceDescriptionService description
FDServiceExecutableConfigured path to the application to run as a service, expanded in the context of the service process.
FDServiceWorkDirConfigured folder path for the application to run as a service, expanded in the context of the service process.
FDServiceParametersConfigured parameters for the application to run as a service, expanded in the context of the service process.
FDDateDate of when the service has commenced startup, expressed in local time.

Format: yyyyMMdd

FDTime

Time of when the service has commenced startup, expressed in 24-hour local time.

Format: HHmmss


Upon launch and during the lifetime of the service, the following environment variables are available:


VariableDescription
FDProcessRunInSessionOfWhen invoked in the current user's session: <user name>@<domain name>. Otherwise, empty.
FDProcessScheduleNameThe name of the schedule responsible for launching the service. If no schedule was involved, the variable is undefined.
FDProcessScheduleDateDate when the service executable has been scheduled to start, expressed in local time.

Format: yyyyMMdd

FDProcessScheduleTimeTime when the service executable has been scheduled to start, expressed in 24-hour local time. Format: HHmmss
FDProcessFailCountThe current value of the fail counter.
FDProcessFlapCountThe current value of the flap counter.


Additional FireDaemon Pro environment variables are made available to after-launch and before-termination event programs:


VariableDescription
FDProcessId
Process Id of the service executable's process.
FDProcessCreationTime

Creation date+time of the service executable's process in extended ISO 8601 time. Format: yyyy-MM-ddTHH:mm:ss.fffff


Additional FireDaemon Pro environment variables are made available to after-termination event programs:


Variable
Description
FDProcessId
Process Id of the service executable's process.
FDProcessCreationTime
Creation date+time of the service executable's process in extended ISO 8601 time. Format: yyyy-MM-ddTHH:mm:ss.fffff
FDProcessExitCode

int32 value of the service executable's process' exit code. In case the after-termination event program is run right after an entirely unsuccessful launch of the subprocess this environment variables isn't available