A control device configured to control an equipment or a machine, the control device comprising: one or more processors; a general-purpose operating system, a hypervisor, and a real-time operating system executed in parallel on the one or more processors, the control device being characterized in that the general-purpose operating system and the real-time operating system are executed under a virtual environment using the hypervisor, wherein the real-time operating system provides an execution environment of a user program to realize a control over the equipment or the machine; and an input interface configured for receiving a cutoff event from an uninterruptable power supply device, wherein the real-time operating system is configured to execute: a function of executing (SQ102, SQ104, SQ106) a shutdown preparation process including output of a shutdown notification to the user program, upon which the user program executes a process required for safe shutdown of the user program, wherein the shutdown preparation process is required for a shutdown of the real-time operating system in response to the cutoff event, wherein the shutdown preparation process is considered completed when the real-time operating system receives a notification from the user program that the process required for safe shutdown of the user program is completed or when a time that has passed since the shutdown notification has exceeded a first timeout time (Tu); after completion of the shutdown preparation process, a function of instructing the general-purpose operating system to shut down after executing the shutdown preparation process; and a function of completing the shutdown of the real-time operating system and outputting a power supply stop permission to the uninterruptable power supply device such that a power supply of the control device is cut off when a notification of shutdown completion is received from the general-purpose operating system or when a second timeout time (Tw) has passed since the general-purpose OS is instructed to shut down. one or more processors; a general-purpose operating system, a hypervisor, and a real-time operating system executed in parallel on the one or more processors, the control device being characterized in that the general-purpose operating system and the real-time operating system are executed under a virtual environment using the hypervisor, wherein the real-time operating system provides an execution environment of a user program to realize a control over the equipment or the machine; and an input interface configured for receiving a cutoff event from an uninterruptable power supply device, wherein the real-time operating system is configured to execute: a function of executing (SQ102, SQ104, SQ106) a shutdown preparation process including output of a shutdown notification to the user program, upon which the user program executes a process required for safe shutdown of the user program, wherein the shutdown preparation process is required for a shutdown of the real-time operating system in response to the cutoff event, wherein the shutdown preparation process is considered completed when the real-time operating system receives a notification from the user program that the process required for safe shutdown of the user program is completed or when a time that has passed since the shutdown notification has exceeded a first timeout time (Tu); after completion of the shutdown preparation process, a function of instructing the general-purpose operating system to shut down after executing the shutdown preparation process; and a function of completing the shutdown of the real-time operating system and outputting a power supply stop permission to the uninterruptable power supply device such that a power supply of the control device is cut off when a notification of shutdown completion is received from the general-purpose operating system or when a second timeout time (Tw) has passed since the general-purpose OS is instructed to shut down. a function of executing (SQ102, SQ104, SQ106) a shutdown preparation process including output of a shutdown notification to the user program, upon which the user program executes a process required for safe shutdown of the user program, wherein the shutdown preparation process is required for a shutdown of the real-time operating system in response to the cutoff event, wherein the shutdown preparation process is considered completed when the real-time operating system receives a notification from the user program that the process required for safe shutdown of the user program is completed or when a time that has passed since the shutdown notification has exceeded a first timeout time (Tu); after completion of the shutdown preparation process, a function of instructing the general-purpose operating system to shut down after executing the shutdown preparation process; and a function of completing the shutdown of the real-time operating system and outputting a power supply stop permission to the uninterruptable power supply device such that a power supply of the control device is cut off when a notification of shutdown completion is received from the general-purpose operating system or when a second timeout time (Tw) has passed since the general-purpose OS is instructed to shut down.