How to configure and run TIBCO Cloud - Proxy Agent (tibtunnel) as a Windows Service

How to configure and run TIBCO Cloud - Proxy Agent (tibtunnel) as a Windows Service

book

Article ID: KB0073762

calendar_today

Updated On:

Products Versions
TIBCO Cloud -

Description

Starting with tibtunnel version 2.3.1 (build 79), tibtunnel can be registered as a Windows service using the standard Windows "sc" command. When running tibtunnel as a service, it is recommended that the owner of the process to be a service account.

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

Issue/Introduction

Steps to configure and run tibtunnel as a Windows Service

Resolution

Steps to configure tibtunnel as a Windows Service

1.Copy the tibtunnel.exe binary to a directory say C:\TIBCO\tunnel

2. Open a Windows Command Prompt as an Administrator.

3.Configure a tibtunnel profile using your AccessKey
C:\TIBCO\tunnel\tibtunnel.exe configure --profile <profileName> --config-dir <congigDir> --accessKey <Tibtunnel AccessKey Secret>
  • --config-dir <configDir> Applicable to both “configure” and “connect” commands. It can be used to specify the full path to the directory where to store the configuration file(s) (default "~/.tibtunnel")
  • --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. Create Windows service (using the auto-discovery connectURL)
sc create <TIBTUNNEL_SERVICE_NAME> binpath= "<TIBTUNNEL_EXECUTABLE_PATH> connect --log-file <TIBTUNNEL_LOG_FILE> --config-dir <TIBTUNNEL_CONFIG_DIR> --profile <TIBTUNNEL_PROFILE_NAME> -s <TIBTUNNEL_SPECS> <TIBTUNNEL_CONNECT_URL>" start= auto DisplayName= "<TIBTUNNEL_SERVICE_NAME>"

5. Add description to the above created service
sc description <TIBTUNNEL_SERVICE_NAME> "<TIBTUNNEL_SERVICE_DESCRIPTION>"


6. Start Windows service
sc start <TIBTUNNEL_SERVICE_NAME>
The service log will be written to the file we set above using --log-file

7. At this point, you should have a service "tibtunnel" running. You can check the service status using the services.msc Windows application or by issuing command
sc query <TIBTUNNEL_SERVICE_NAME>


8. To delete a service, stop it first and then delete it using the sc command:

sc stop <TIBTUNNEL_SERVICE_NAME>
sc delete <TIBTUNNEL_SERVICE_NAME>

Additional Information