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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user