mps-stop

Stop a server instance

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. All function requests that were executing when the command was issued are allowed to complete before the server shuts down.

Input Arguments

-C path/

Specify a path to the server instance.

If you are stopping 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 current working folder and its parents are searched to find the server instance.

server_name

Name of the server to be stopped.

-f

Force success even if the server instance is not 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.

Starting in R2020a, 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.

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

Starting in R2020a, 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.

    mps-stop -f -v -C /tmp/server_1 --timeout 00:03:00
    

    Example Output

    waiting for stop... (timeout = 00:03:00)
    
  • Immediately terminate all running server instance processes by force using the -k option.

    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.

    mps-stop /tmp/server_1

Tips

  • After issuing mps-stop, issue the mps-status command to verify that the server instance has stopped.

Introduced in R2012b