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

Removing SIGINT stop signals from Dockerfiles and systemd service #620

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dist/systemd/system/keylime_agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ After=tpm2-abrmd.service

[Service]
ExecStart=/usr/bin/keylime_agent
KillSignal=SIGINT
TimeoutSec=60s
Restart=on-failure
RestartSec=120s
Expand Down
3 changes: 0 additions & 3 deletions docker/release/Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ ENV RUST_LOG=keylime_agent=info
# it's good practice to declare this in the Dockerfile
EXPOSE 9002/tcp

# define the stopsignal to be SIGINT like the systemd service file does
STOPSIGNAL SIGINT

# these are all podman labels that work with the 'podman container runlabel' command, and are standardized at least in RHEL (install, uninstall, run)
LABEL install="podman volume create keylime-agent"
LABEL uninstall="podman volume rm keylime-agent"
Expand Down
3 changes: 0 additions & 3 deletions docker/release/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ ENV RUST_LOG=keylime_agent=info
# it's good practice to declare this in the Dockerfile
EXPOSE 9002

# define the stopsignal to be SIGINT like the systemd service file does
STOPSIGNAL SIGINT

# these are all podman labels that work with the 'podman container runlabel' command, and are standardized at least in RHEL (install, uninstall, run)
LABEL install="podman volume create keylime-agent"
LABEL uninstall="podman volume rm keylime-agent"
Expand Down
3 changes: 0 additions & 3 deletions docker/release/Dockerfile.wolfi
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ ENV RUST_LOG=keylime_agent=info
# it's good practice to declare this in the Dockerfile
EXPOSE 9002/tcp

# define the stopsignal to be SIGINT like the systemd service file does
STOPSIGNAL SIGINT

# these are all podman labels that work with the 'podman container runlabel' command, and are standardized at least in RHEL (install, uninstall, run)
LABEL install="podman volume create keylime-agent"
LABEL uninstall="podman volume rm keylime-agent"
Expand Down
2 changes: 2 additions & 0 deletions keylime-ima-emulator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use log::*;

use clap::Parser;
use signal_hook::consts::SIGINT;
use signal_hook::consts::SIGTERM;
use std::collections::HashMap;
use std::convert::{TryFrom, TryInto};
use std::fs::File;
Expand Down Expand Up @@ -216,6 +217,7 @@ fn main() -> std::result::Result<(), ImaEmulatorError> {

let shutdown_marker = Arc::new(AtomicBool::new(false));
signal_hook::flag::register(SIGINT, Arc::clone(&shutdown_marker))?;
signal_hook::flag::register(SIGTERM, Arc::clone(&shutdown_marker))?;
println!("Monitoring {}", args.ima_log.display());
while !shutdown_marker.load(Ordering::SeqCst) {
for (pcr_hash_alg, position) in positions.iter_mut() {
Expand Down