A non-transitory computer-readable storage medium storing a program configured to, when executed by a computer, cause the computer to perform a method of controlling a printing apparatus of which power states include at least a normal state, a power saving state, a first turned off state, and a second turned off state, the printing apparatus including a switch used by a user to turn off the printing apparatus and a storage device that stores a set of instructions, the method comprising the steps of:
- setting one of at least two modes including an initialization mode and a resume mode,
- wherein, in the initialization mode, the printing apparatus is started from an initialized state, and, in the resume mode, the printing apparatus is started from a resumed state,
- wherein, in a case where the resume mode is set, the printing apparatus is controlled to perform the steps of:
- receiving a turn off signal in a case where the switch is operated by the user to turn off the printing apparatus;
- shifting, in a case where no operation is performed in the normal state over a predetermined time period, the printing apparatus to the power saving state,
- shifting, in a case where a predetermined return factor occurs in the power saving state, the printing apparatus to the normal state, without an operation of the switch by the user;
- shifting, in response to the reception of the turn off signal, the printing apparatus to the first turned off state, at least under a condition that the printing apparatus is not in a predetermined state, and
- shifting, in response to the reception of the turn off signal, the printing apparatus to the second turned off state, at least under a condition that the printing apparatus is in the predetermined state,
- shifting, in a case where the switch is operated by the user to turn on the printing apparatus in the first turned off state, the printing apparatus to the normal state, and
- shifting, in a case where the switch is operated by the user to turn on the printing apparatus in the second turned off state, the printing apparatus to the normal state,
- wherein the predetermined state includes at least one of
- a state in which a job to be executed by the printing apparatus is not executed properly,
- a state in which an error has occurred on a software in a memory, turning off to the second turned off state being required to recover the image forming apparatus from the error,
- a state in which update of a kernel of an Operating System (OS) is required,
- a state in which change of the kernel is required, or
- a state in which reboot of a module driver is required, and
- wherein
- power is supplied to the memory during the first turned off state, and power is not supplied to the memory during the second turned off state,
- wherein, in a case where the initialization mode is set, the printing apparatus is controlled to perform the steps of:
- receiving a turn off signal in a case where the switch is operated by the user to turn off the printing apparatus;
- and
- shifting, in response to the reception of the turn off signal, the printing apparatus to the second turned off state so that the printing apparatus is initialized in the next start processing of the printing apparatus, irrespective of whether or not the printing apparatus is in the predetermined state.