spectrum: kill a cava left by an earlier shell on start

stopping the shell leaves its cava running (parent 1), reading on from a
closed pipe and ignoring SIGTERM; every restart while music played leaked
one. on start, pkill -KILL -f our cava.conf before starting our own
This commit is contained in:
server2
2026-10-08 01:25:33 +02:00
parent 85416b501e
commit 967ff37b78
+6
View File
@@ -35,6 +35,12 @@ impl Service for Spectrum {
fn listen() {
let config = art::folder().join("cava.conf");
/*
* a cava left by an earlier shell: stopping the shell doesn't stop its cava,
* which reads on from a closed pipe and ignores SIGTERM. none of ours runs yet
*/
let _ = Command::new("pkill").arg("-KILL").arg("-f").arg(&config).status();
let _ = fs::write(&config, cava_config());
let mut running: Option<Capture> = None;