How to run TIBCO Cloud - Proxy Agent (tibtunnel) as a Background Windows Task/Process

How to run TIBCO Cloud - Proxy Agent (tibtunnel) as a Background Windows Task/Process

book

Article ID: KB0073763

calendar_today

Updated On:

Products Versions
TIBCO Cloud -

Description

Starting with TIBCO Cloud - Proxy Agent (tibtunnel)  version 2.3.1(build 77), tibtunnel can be started as a Windows background process that can be gracefully stopped using the "taskkill" Windows command. For production systems, we recommend running as a Windows service.

Prerequisites:
1. Download the TIBCO Cloud - Proxy Agent binary.

https://integration.cloud.tibco.com/docs/index.html#tci/using/hybrid-agent/agent-requirements.html
2. Created an AccessKey using the TIBCO Cloud Web User Interface and make a note of the <AccessKey secret> and the <ConnectURL> associated with this AccessKey.
https://account.cloud.tibco.com/cloud/docs/proxy-agent/creating_access_key.html


Note: In Windows, a background process remains attached to the parent process. That means that a background process started using "start /b" will be automatically terminated when the parent process ends. If the parent is a command prompt window, closing the command prompt will also terminate the background processes.

Issue/Introduction

Steps to run tibtunnel as a Background Windows process and graceful stop

Resolution

1. Open a Windows Command Prompt

2. Configure a tibtunnel profile using your AccessKey
tibtunnel.exe configure --profile <TIBTUNNEL_PROFILE_NAME> --accessKey <TIBTUNNEL_ACCESS_KEY_SECRET>

3.Start tibtunnel as a background process using Windows command "start /B
start /b  tibtunnel.exe connect --log-file <TIBTUNNEL_LOG_FILE> --profile <TIBTUNNEL_PROFILE_NAME> -s <TIBTUNNEL_SPECS> <TIBTUNNEL_CONNECT_URL>

--log-file <logFilePath> Applicable only for the “connect” command, and represents the full path to the output log file. If not specified, the logs will be printed on stdout. The logs will be appended to the specified file (i.e. previous content is not lost). The implementation allows 3rd party tools to implement a log rotation mechanism (for Windows, we recommend to use copy-and-truncate mechanism for log rotation)
 

4. The tibtunnel process will run as a background process. Please keep the command window open (closing it will forcefully kill the background process). To stop it gracefully, continue with step 5 below
 

5. Find out the process ID of the background tibtunnel service

tasklist /FI "imagename eq tibtunnel.exe"

The output of the above command will list the process ID (i.e. PID) of the tibtunnel service. For example, in the below sample output the PID is 2468

Output sample for "tasklist" command

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
tibtunnel.exe                 2468 Console                    1     14,440 K


6.Gracefully stop the tibtunnel background service using the taskkill command. For example, if the PID is 2468, we will issue the following command

taskkill /T /PID 2468

 

Additional Information