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> |