Unix Reboot System
- Task type:
ssh_rebootsystem
Description
The Unix Reboot System task allows you to reboot the operating system on a local machine (in Default mode) or on a remote server via SSH by sending a reboot command.
It is used to automate maintenance tasks, apply updates that require a reboot, or restore the system in a controlled manner.
Configuration
Configuration defines the execution mode (local or remote), reboot-related parameters, and any notification message for users. Task configuration fields can be set manually or via workflow parameters and variables.
Server Connection
- Connection mode: defines the source of credentials and the execution type. It can assume three operational modes:
- Default: Commands are executed on the local machine, without an SSH connection.
- Manual: Allows manual entry of SSH connection parameters.
- Environment: Uses a preconfigured connection environment. In this mode, a menu is displayed listing available connections based on the role associated with the Workflow.
- IP Address: IP address of the remote server.
- Hostname: Hostname of the remote server.
- User: Username used to establish the SSH connection.
- Password: Password associated with the connection user.
- Port: Port used for the SSH connection (the default value is 22).
Execute command as another user
By enabling this checkbox, you can execute the command with a user different from the one used for the SSH connection.
- User: Name of the user with whom the command will be executed.
- Password: Password of the user used to execute the command.
Reboot Details
- Timeout (Minutes): Specifies after how many minutes from task execution the server will actually be rebooted. This is not a connection timeout, but the wait time before the reboot.
- Message: The notification message that will be sent to all users currently connected to the server via terminal to warn them of the imminent reboot.
Output Parameters
Upon completion of the task, the following output parameters are exposed:
- result: Contains a text message describing the outcome of the operation or an error message (e.g., "Missing server address").
- resultJson: Represents the result of the task execution in JSON format, including general information, configurations, and execution details.
- exitStatus: Returns the exit code of the reboot command. A value of 0 indicates that the command was scheduled successfully.
Example resultJson parameter
{
"run_info": {
"status": "Completed",
"run_result": "Success"
},
"output_parameters": {
"exitStatus": "0"
}
}
Important Notes
The task establishes an SSH connection with the remote server and executes the server reboot command as configured. If you use SSH key authentication, the public key must be registered on the remote server. If the "Execute command as another user" option is enabled, the command is executed with a user different from the main SSH connection user.