Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UnloadHook to Sensors #332

Merged
merged 1 commit into from
Aug 22, 2022
Merged

Conversation

kevsecurity
Copy link
Contributor

Some sensors need to perform additional work when unloaded, in order to
leave the system in a clean state, as part of facilitating the
capability to load and unload sensors repeatedly. A clear example would
be if a sensor installed a timer (an implementation of a stopable
ticker) in an enable function.

This commit adds an UnloadHook that can optionally be set by a sensor to
point to a function to call, prior to the programs and maps being
unloaded, when the sensor is being unloaded.

Signed-off-by: Kevin Sheldrake [email protected]

@kevsecurity kevsecurity requested a review from a team as a code owner August 17, 2022 15:52
Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection, but please see my comment.

pkg/sensors/sync.go Show resolved Hide resolved
pkg/sensors/sync.go Show resolved Hide resolved
pkg/sensors/sync.go Outdated Show resolved Hide resolved
@kevsecurity kevsecurity force-pushed the pr/kevsecurity/add-unload-hook branch from 816c98d to 1edcb76 Compare August 22, 2022 12:27
Some sensors need to perform additional work when unloaded, in order to
leave the system in a clean state, as part of facilitating the
capability to load and unload sensors repeatedly. A clear example would
be if a sensor installed a timer (an implementation of a stopable
ticker) in an enable function.

This commit adds an UnloadHook that can optionally be set by a sensor to
point to a function to call, prior to the programs and maps being
unloaded, when the sensor is being unloaded.

Signed-off-by: Kevin Sheldrake <[email protected]>
@kevsecurity kevsecurity force-pushed the pr/kevsecurity/add-unload-hook branch from 1edcb76 to 63a5592 Compare August 22, 2022 15:00
@kevsecurity kevsecurity merged commit 1b34698 into main Aug 22, 2022
@kevsecurity kevsecurity deleted the pr/kevsecurity/add-unload-hook branch August 22, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants