Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Dobby RDK OOMCrash Plugin. More...
#include <OOMCrashPlugin.h>
Public Member Functions | |
OOMCrash (std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath) | |
Constructor - called when plugin is loaded by PluginLauncher. More... | |
std::string | name () const override |
Should return the name of the plugin. More... | |
unsigned | hookHints () const override |
Set the bit flags for which hooks we're going to use. More... | |
bool | postInstallation () override |
Dobby Hook - run in host namespace once when container bundle is downloaded. More... | |
bool | postHalt () override |
Dobby Hook - Run in host namespace when container terminates. | |
std::vector< std::string > | getDependencies () const override |
Should return the names of the plugins this plugin depends on. More... | |
Public Member Functions inherited from RdkPluginBase | |
virtual bool | preCreation () |
virtual bool | createRuntime () |
virtual bool | createContainer () |
virtual bool | postStart () |
virtual bool | postStop () |
Private Member Functions | |
bool | readCgroup (unsigned long *val) |
Read cgroup file. More... | |
bool | checkForOOM () |
Check for Out of Memory by reading cgroup file. More... | |
void | createFileForOOM () |
Create OOM crash file named oom_crashed_<container_name>.txt on the configured path. | |
Private Attributes | |
const std::string | mName |
std::shared_ptr< rt_dobby_schema > | mContainerConfig |
const std::string | mRootfsPath |
const std::shared_ptr< DobbyRdkPluginUtils > | mUtils |
Additional Inherited Members | |
Public Types inherited from IDobbyRdkPlugin | |
enum | HintFlags : unsigned { PostInstallationFlag = (1 << 0) , PreCreationFlag = (1 << 1) , CreateRuntimeFlag = (1 << 2) , CreateContainerFlag = (1 << 3) , PostStartFlag = (1 << 5) , PostHaltFlag = (1 << 6) , PostStopFlag = (1 << 7) , Unknown = 0 } |
Bit flags that should be returned by hookHints. More... | |
OOMCrash::OOMCrash | ( | std::shared_ptr< rt_dobby_schema > & | containerConfig, |
const std::shared_ptr< DobbyRdkPluginUtils > & | utils, | ||
const std::string & | rootfsPath | ||
) |
Constructor - called when plugin is loaded by PluginLauncher.
Do not change the parameters for this constructor - must match C methods created by REGISTER_RDK_PLUGIN macro
Note plugin name is not case sensitive
|
private |
Check for Out of Memory by reading cgroup file.
|
overridevirtual |
Should return the names of the plugins this plugin depends on.
This can be used to determine the order in which the plugins should be processed when running hooks.
Reimplemented from RdkPluginBase.
|
overridevirtual |
Set the bit flags for which hooks we're going to use.
This plugin uses the postInstallation and postHalt hooks, so set those flags
Implements IDobbyRdkPlugin.
|
inlineoverridevirtual |
Should return the name of the plugin.
Implements IDobbyRdkPlugin.
|
overridevirtual |
Dobby Hook - run in host namespace once when container bundle is downloaded.
Reimplemented from RdkPluginBase.
|
private |
Read cgroup file.
[out] | val | gives the number of times that the cgroup limit was exceeded. |