Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function determines if your system requires a reboot to apply quotas, software package updates, or kernel updates.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/system_needs_reboot?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/system_needs_reboot?api.version=1
 Command Line
whmapi1 system_needs_reboot

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{  
   "metadata":{  
      "version":1,
      "result":1,
      "command":"system_needs_reboot",
      "reason":"OK"
   },
	"needs_reboot" : 1,
    "details" : {
        "quota" : 1,
        "kernel" : 
			"running_version" : "3.10.0-514.6.2.el7.x86_64"
			"boot_version" : "3.10.0-514.10.2.el7.x86_64"
        "updates" : { 
            "glibc" : "2.17-157.el7_3.1", 
            "openssl-libs" : "1:1.0.1e-60.el7_3.1" 
        }
    }
}
 Output (XML)
<result>
    <data>
        <needs_reboot>1</needs_reboot>
        <details>
			<quota>1</quota>
			<kernel>
				<running_version>3.10.0-514.6.2.el7.x86_64</running_version>
				<boot_version>3.10.0-514.10.2.el7.x86_64</boot_version>
			</kernel>
			<updates>
				<glibc>2.17-157.el7_3.1</glibc>
				<openssl-libs>1:1.0.1e-60.el7_3.1</openssl-libs>
			</updates>
		</details>
    </data>
    <metadata>
        <command>system_needs_reboot</command>
        <reason>OK</reason>
        <result>1</result>
        <version>1</version>
    </metadata>
</result>

Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible ValuesExample
needs_rebootBooleanWhether the system requires a reboot.
  • 1 — System requires a reboot.
  • 0 — System does not require a reboot.
0
detailshashA hash that contains reasons why the system requires a reboot.This hash contains the quota and kernel returns, and the updates hash.Kernel

quota

Boolean

Whether the system requires a reboot to enable quotas.

Note:

  • The function only returns this value if the kernel updates and requires a reboot.
  • We introduced this return in cPanel & WHM version 66.

  • 1 — System requires a reboot to enable quotas.

    Note:

    1 is the only possible value.

1

kernel

hash

A hash of kernel versions.

Note:

  • The function only returns this hash if the kernel updates and requires a reboot.
  • In cPanel & WHM version 64, this return was a Boolean value. We changed this return in cPanel & WHM version 66.

This hash includes the running_version and boot_version returns.

 

 

running_version

string

The kernel version that the server currently runs.

Note:

We introduced this return in cPanel & WHM version 66.

A valid kernel version.3.10.0-514.6.2.e17.x86_64
 

boot_version

string

The version that the system's kernel updated to.

Note:

We introduced this return in cPanel & WHM version 66.

A valid kernel version.3.10.0-514.10.2.e17.x86_64
 

updates

hash

A hash of software packages and their most recent versions.

Notes:

  • The return names in this hash are the software packages that require updates.
  • The function only returns this hash if software packages on your server require updates.
  • We introduced this return in cPanel & WHM version 66.
This hash contains the software that requires an update and their most recent versions.glibc : 2.17-157.el7_3.1