Main Content

mps-stop

Stop server instance from command line on Windows, Linux, and macOS systems

Syntax

mps-stop [-C [path/]server_name] [-f] [-p | --purge] [-k | --kill] [-v] [--timeout hh:mm:ss]

Description

mps-stop [-C [path/]server_name] [-f] [-p | --purge] [-k | --kill] [-v] [--timeout hh:mm:ss] closes the HTTP server socket and all open client connections immediately. When you issue mps-stop, all function requests that the server was executing are allowed to complete before the server shuts down.

If you want to delete a server instance directory, you can delete it after the instance has stopped. You can issue the mps-status command to verify that the server instance has stopped.

Input Arguments

-C path/

Specify a path to the server instance.

If you want to stop a server instance in the current working folder, you do not need to specify a full path; only specify the server name. If you omit this option, the system searches the current working folder and its parents to find the server instance.

server_name

Name of the server to stop.

-f

Force success even if the server instance is currently stopped. Stopping a stopped instance is considered an error.

-p | --purge

Remove working files in the instance directory. These files are usually removed during a graceful shutdown.

-k | --kill

Immediately and forcibly terminate any running processes for this instance. Use this option if a graceful shutdown has failed.

If you specify both -k|--kill and --timeout hh:mm:ss options, all running server instance processes are forcibly terminated at hh:mm:ss; if they have not already stopped.

To forcibly terminate server instance processes within the duration specified by the server-termination-grace-period property, do not specify the -k option.

You cannot forcibly terminate a server instance that is running as a Windows® service.

-v

Display system messages.

--timeout hh:mm:ss

Set a limit on how long mps-stop runs before returning either success or failure. If you specify the --timeout option, the server tries to gracefully shut down and release any checked out licenses.

For example, if you specify --timeout 00:02:00, then mps-stop exits with a message if the server takes longer than two minutes to shut down. The server instance continues to attempt to terminate even if mps-stop times out. If you do not specify this option, the default behavior is to wait as long as necessary (infinity) for the instance to stop.

If you specify both -k|--kill and --timeout hh:mm:ss options, all running server instance processes are forcibly terminated at hh:mm:ss; if they have not already stopped.

Examples

Stop a server instance server_1 located in the tmp folder.

  • Force successful completion of mps-stop using -f option. Use --timeout option to return with a message, if mps-stop takes longer than three minutes to complete. Specify the verbose -v option to produce an output status message.

    Type the following at the system command line:

    mps-stop -f -v -C /tmp/server_1 --timeout 00:03:00
    
    waiting for stop... (timeout = 00:03:00)
    
  • Immediately terminate all running server instance processes by force using the -k option.

    Type the following at the system command line:

    mps-stop -k /tmp/server_1
  • To wait as long as necessary to stop server instance processes, do not specify the --timeout option or set the server-termination-grace-period property in the main_config server configuration file.

    Type the following at the system command line:

    mps-stop /tmp/server_1

Version History

Introduced in R2012b