-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathReboot.hpp
46 lines (37 loc) · 1.05 KB
/
Reboot.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* SPDX-FileCopyrightText: Copyright SUSE LLC */
/*
Wrapper for reboot methods
*/
#ifndef T_U_REBOOT_H
#define T_U_REBOOT_H
#include <string>
namespace TransactionalUpdate {
class Reboot
{
public:
/**
* @brief Reboot the system using the given reboot method
* @param method reboot method; possible values: auto|rebootmgr|systemd|notify|kured|kexec|none
*
* "auto" will either use rebootmgr if active, or systemd otherwise. Will throw an exception if
* the requested method is not available.
*
* See `man 5 transactional-update.conf` for a description of the individual methods.
*
* The "kexec" reboot method is deprecated.
*/
Reboot(std::string method);
virtual ~Reboot() = default;
/**
* @brief Trigger the actual reboot.
*/
void reboot();
protected:
/**
* @brief Contains the command which will be triggered during reboot().
*/
std::string command;
};
} // namespace TransactionalUpdate
#endif // T_U_REBOOT_H