Skip to content

async command

Ryan Newington edited this page Jun 5, 2017 · 2 revisions

<async-command> (asynchronous command)

Asynchronous commands are used when a command may prompt the user for additional input after the command has executed, but before it exits. A common example of this is a password change command that executes and then prompts the user to enter their password. A synchronous command is not capable of responding to this input request, unless the command supports piping the information in from the command line.

Supported behaviours

Asynchronous commands support the following behaviours:

  • Providing additional input to the standard input (stdin) after a command has been executed. If the program being executed does not require additional user input, use a synchronous command instead

Asynchronous commands do not support:

  • Asynchronous command cannot be used to extract objects for import into FIM
  • Asynchronous commands cannot use exit or return codes to determine the success or failure of a command

Asynchronous commands support the following child elements;

The success-when element must appear last in the list of child elements. At least one send or send-when elements must be present in the <async-command> element.

Example

<async-command>
    <send-when expect="$ " timeout="5">/usr/local/bin/sudo /usr/bin/passwd {dn:$1}</send-when>
    <send-when expect="New Password: " timeout="5">{newpassword}</send-when>
    <send-when expect="assword: " timeout="5">{newpassword}</send-when>
    <success-when expect="password successfully changed for {dn:$1}" timeout="5"/>
</async-command>
Clone this wiki locally