Open cryptrr opened 3 days ago
I am running a python script using shell.run()
But even after interrupt() or even shutdown(), the subprocess spawned inside the python script still keeps running.
interrupt()
shutdown()
val result = shell.run(command) Timber.d("Exit Code ${result.exitCode}") //Correctly receives non zero exit code.
Is this an issue with signal forwarding or am I doing anything wrong?
init { main.viewModelScope.launch { main.eventFlow.collect{ when(it){ is ViewModelEvent.CancelProcess -> { CoroutineScope(Dispatchers.IO).launch { //Event is fired shell.interrupt() } } else -> {} } } } } shell = Shell("/path/to/sh") fun runCommandForShareWithEnv(command: String){ CoroutineScope(Dispatchers.IO).launch{ val result = shell.run(command) Timber.d("Exit Code ${result.exitCode}") //Correctly receives non zero exit code. } }
This is for a FOSS project. https://github.com/cryptrr/AutoPie
I am running a python script using shell.run()
But even after
interrupt()
or evenshutdown()
, the subprocess spawned inside the python script still keeps running.Is this an issue with signal forwarding or am I doing anything wrong?