ENH make sure child processes are also killed

This commit is contained in:
Nathan Dwarshuis 2022-12-28 13:29:35 -05:00
parent fb9b9fa65e
commit a6ef4c8c50
3 changed files with 4 additions and 5 deletions

View File

@ -189,7 +189,7 @@ features cl = FeatureSet
startXmobar :: FIO (Process Handle () ())
startXmobar = do
p <- proc "xmobar" [] (startProcess . setStdin createPipe)
p <- proc "xmobar" [] (startProcess . setStdin createPipe . setCreateGroup True)
io $ hSetBuffering (getStdin p) LineBuffering
return p
@ -263,8 +263,7 @@ runCleanup ts db = io $ do
killNoWait p = do
let ph = unsafeProcessHandle p
i <- getPid ph
forM_ i $ signalProcess sigTERM
-- terminateProcess ph
forM_ i $ signalProcessGroup sigTERM
stopNoWait p
--------------------------------------------------------------------------------

View File

@ -257,7 +257,7 @@ runNetAppDaemon cl = Sometimes "network applet" xpfVPN
where
tree = toAnd_ app $ Bus networkManagerPkgs networkManagerBus
app = DBusIO $ sysExe [Package Official "network-manager-applet"] "nm-applet"
cmd _ = proc "nm-applet" [] startProcess
cmd _ = proc "nm-applet" [] (startProcess . setCreateGroup True)
runToggleBluetooth :: Maybe SysClient -> SometimesX
runToggleBluetooth cl = Sometimes "bluetooth toggle" xpfBluetooth

View File

@ -93,7 +93,7 @@ runAutolock = sometimesIO_ "automatic screen lock" "xss-lock" tree cmd
where
tree = And_ (Only_ $ sysExe [Package Official "xss-lock"] "xss-lock")
$ Only_ $ IOSometimes_ runScreenLock
cmd = proc "xss-lock" ["--ignore-sleep", "screenlock"] startProcess
cmd = proc "xss-lock" ["--ignore-sleep", "screenlock"] (startProcess . setCreateGroup True)
--------------------------------------------------------------------------------
-- | Confirmation prompts