Running the TIBCO Cloud™ - Proxy Agent as a Windows Service

You can run the TIBCO Cloud - Proxy Agent as a Windows service.

Before you Begin

  • When running the TIBCO Cloud - Proxy Agent as a service, the owner of the process must be a service account.

  • TIBCO Cloud - Proxy Agent must be configured by using a custom profile location.

  • Choose the location where you want to store the logs.

Assumptions

  • A directory C:\TIBCO\tunnel exists and contains the tibtunnel.exe binary.

  • The configuration and the logs files are stored in the same directory.

  • The AccessKey has been created and you know the <AccessKey Secret> and the ConnectURL associated with it.

    Procedure
  1. Open a Windows command prompt as an Administrator.

  2. Set up the following environment variables and ensure to set the values for TIBTUNNEL_ACCESS_KEY_SECRET, TIBTUNNEL_SPECS, and TIBTUNNEL_CONNECT_URL to match your environment:

  3. set TIBTUNNEL_CONFIG_DIR=C:\TIBCO\tunnel
    
    set TIBTUNNEL_EXECUTABLE=C:\TIBCO\tunnel\tibtunnel.exe
    set TIBTUNNEL_LOG_FILE=C:\TIBCO\tunnel\tibtunnel-service.log
    set TIBTUNNEL_PROFILE_NAME=tutorial set TIBTUNNEL_SERVICE_NAME=tibtunnel
    set TIBTUNNEL_SERVICE_DESCRIPTION=TIBCO Cloud Proxy Agent
    set TIBTUNNEL_SPECS=-s 8080:localhost:8080 -s 7771:localhost:7771
    set TIBTUNNEL_ACCESS_KEY_SECRET=<your AccessKey secret>
    set TIBTUNNEL_CONNECT_URL=<your connectURL>
  4. Configure the TIBCO Cloud - Proxy Agent profile by using your AccessKey

    %TIBTUNNEL_EXECUTABLE% configure --profile %TIBTUNNEL_PROFILE_NAME% --config-dir %TIBTUNNEL_CONFIG_DIR% --accessKey %TIBTUNNEL_ACCESS_KEY_SECRET%
    
  5. Create a Windows service and start the service.

    sc create %TIBTUNNEL_SERVICE_NAME% binpath= "%TIBTUNNEL_EXECUTABLE% connect --log-file %TIBTUNNEL_LOG_FILE% --config-dir %TIBTUNNEL_CONFIG_DIR% --profile %TIBTUNNEL_PROFILE_NAME% %TIBTUNNEL_SPECS% %TIBTUNNEL_CONNECT_URL%" start= auto DisplayName= "%TIBTUNNEL_SERVICE_NAME%" 
    sc description %TIBTUNNEL_SERVICE_NAME% "%TIBTUNNEL_SERVICE_DESCRIPTION%"
    sc start %TIBTUNNEL_SERVICE_NAME%

Check the service status

sc query %TIBTUNNEL_SERVICE_NAME%

Delete a service

To delete a service, you must first stop it and then delete it as follows:

sc stop %TIBTUNNEL_SERVICE_NAME%

sc delete %TIBTUNNEL_SERVICE_NAME%