Skip to content

Commit

Permalink
cfgen: implement dropin
Browse files Browse the repository at this point in the history
Summary: title says it

Reviewed By: anps77

Differential Revision: D57935308

fbshipit-source-id: bbf25ad8c4a552bc70d4a9c33849ff79c5abded3
  • Loading branch information
Chengxiong Ruan authored and facebook-github-bot committed May 30, 2024
1 parent 651bc3e commit b95708e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
19 changes: 14 additions & 5 deletions src/oomd/cfgen/src/cfgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ fn oomd_json(node: &Node) -> Result<json::JsonValue, anyhow::Error> {
}
}

fn oomd_dropin(node: &Node) -> Dropin {
// TODO(chengxiong): implement this
libcfgen::DropinBuilder::new()
.with_recommended_heap_profiling("fb-oomd")
.build(node)
fn oomd_dropin(_node: &Node) -> Dropin {
let args = [
"--interval 1",
"--config /etc/oomd2.json",
"--drop-in-dir /run/oomd/dropin",
];
let environment = convert_args!(btreemap!(
"OOMD_ARGS" => args.join(" "),
));

Dropin {
environment,
..Default::default()
}
}

// Rules generated from this function are based on the original
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@generated SignedSource<<31b3f2f747768088bd5523d8e690bfac>>
@generated SignedSource<<3dd8c7637bb7afa680fc168e9c49060d>>
@codegen-command arc cfgen update-outputs fb-oomd
[Service]
Environment=OOMD_ARGS='--interval 1 --config /etc/oomd2.json --drop-in-dir /run/oomd/dropin'

[Unit]
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@generated SignedSource<<31b3f2f747768088bd5523d8e690bfac>>
@generated SignedSource<<3dd8c7637bb7afa680fc168e9c49060d>>
@codegen-command arc cfgen update-outputs fb-oomd
[Service]
Environment=OOMD_ARGS='--interval 1 --config /etc/oomd2.json --drop-in-dir /run/oomd/dropin'

[Unit]
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@generated SignedSource<<31b3f2f747768088bd5523d8e690bfac>>
@generated SignedSource<<3dd8c7637bb7afa680fc168e9c49060d>>
@codegen-command arc cfgen update-outputs fb-oomd
[Service]
Environment=OOMD_ARGS='--interval 1 --config /etc/oomd2.json --drop-in-dir /run/oomd/dropin'

[Unit]
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@generated SignedSource<<31b3f2f747768088bd5523d8e690bfac>>
@generated SignedSource<<3dd8c7637bb7afa680fc168e9c49060d>>
@codegen-command arc cfgen update-outputs fb-oomd
[Service]
Environment=OOMD_ARGS='--interval 1 --config /etc/oomd2.json --drop-in-dir /run/oomd/dropin'

[Unit]
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@generated SignedSource<<31b3f2f747768088bd5523d8e690bfac>>
@generated SignedSource<<3dd8c7637bb7afa680fc168e9c49060d>>
@codegen-command arc cfgen update-outputs fb-oomd
[Service]
Environment=OOMD_ARGS='--interval 1 --config /etc/oomd2.json --drop-in-dir /run/oomd/dropin'

[Unit]

0 comments on commit b95708e

Please sign in to comment.