Stop and Start the Uniface Router

There may be occasions when you need to stop and restart the Uniface Router for system administrative purposes.

  • You must have elevated privileges or equivalent access rights to start and stop the Uniface Router (URouter) because it normally starts servers running under different user accounts.

    For example, when running commands in the Windows Command app choose Run as Administrator from the context menu .

  • Before stopping the Uniface Router, it is recommended that you stop all client applications registered to it. Failure to do so will cause these applications to stop responding.

    Stopping the Uniface Router using the urouter /stop command is a Forced stop, meaning that all shared servers are stopped immediately, clients are disconnected, and the Uniface Router exits. Client applications and exclusive servers are not stopped.

    When using the Uniface Router Monitor, you can choose a Normal stop, which allows existing clients to deliver requests to servers until the server reports that it has no locks and no context (active component instances). At that moment the server is stopped. Once all the servers are stopped, the remaining clients are disconnected and the Uniface Router exits.

On Windows Platforms

To stop the URouter service on Windows, you can do one of the following:

  • Use the Uniface Router Monitor as a privileged user. This allows you to safely stop both local an remote Uniface Routers. For more information, see Stop Uniface Servers and Routers from the Uniface Router Monitor.
  • Use the Windows Services app. Select the Uniface URouter service, and choose Stop.

    Note: Both the definition and the registry key must be available for the urouter service to be started. When starting, the Uniface Router verifies the existence of the registry key, to ensure it has been correctly installed. If the key is not found an error message will be issued and the URouter will not start.

  • Use the URouter executable to stop the service with the command /stop"ServiceName". For example:
    urouter /stop="Uniface 10 URouter"
  • Run the native Windows program net.exe (equivalent to urouter/stop "ServiceName"). For example:
    net stop "Uniface 10 URouter" 

To start or restart the Uniface Router, use the Windows Services app. Select the Uniface URouter service, and choose Start or Restart, as appropriate.

On Non-Windows Platforms

To stop the Uniface Router on non-Windows platforms, use the URouter executable with the /stop or /shut command.

For example: urouter /stop tcp:+13001

The /stop command is used in conjunction with a new client Uniface Router to stop another running Uniface Router. The new Uniface Router sends a stop message over TCP to the running Uniface Router. Both Uniface Routers must be on the same node.

Note:  If you are using a TLS port, the URouter sending the message is acting as a TLS client of the URouter that is being stopped, and its TLS configuration should reflect that.

To start or restart the Uniface Router on non-Windows platforms, you can use the urouter executable:

urouter {NetworkConnector:+PortNumber} {NetworkConnector:+PortNumber} {NetworkConnector:+PortNumber} {NetworkConnector:+PortNumber}

For example: urouter tcp:+13001 tcp:+13002

On Unix, Uniface provides a script (common/bin/urouter.sh or [.common.bin]urouter.com) that uses this command. The script also provides a restart capability in case the URouter unexpectedly fails. It is therefore recommended that you edit this script and use it to start the Uniface Router.

On iSeries, a CL script that uses this command is provided in file STARTUP member STARTUP. This script does not provide a restart capability.

Stopping a Remote Uniface Router

To stop a remote Uniface Router, you can use the Uniface Router Monitor as a privileged user. For more information, see Stop Uniface Servers and Routers from the Uniface Router Monitor.

It is not possible to use the urouter /stop command to stop a remote Uniface Router.

If you need to stop remote Uniface Routers from scripts, you must create a small application using the UROUTMON component, that calls the CONNECT, ADMLOGON, and UROUTER_SHUT operations. For more information, see UROUTMON .

Starting the Uniface Router with Multiple Listening Threads

The following instruction starts a Uniface Router with three listen threads, the last one over a TLS connection:

  • On Windows, the Uniface Router is installed as a service:

    urouter.exe /inst="Uniface 10 urouter" tcp:+13001 tcp:+13002 tls:+13003:VerySecure

  • On Unix and Linux, it is normally run as a background process:
    nohup urouter.sh tcp:+13001 tcp:+13002 tls:+13003
    &
  • iSeries: Member STARTUP in file STARTUP contains the command to start the URouter, embedded in a SBMJOB command:
    CALL PGM(UNIFLIB/UROUTER) PARM('tcp:+13001' 'tcp:+13002')

Note:  If you do not specify a network on the command line, the value of the $DEFAULT_NET assignment setting is used. If $DEFAULT_NET is not defined, the default protocol is TCP and the default port number is 13001.

Related Topics