ENH make sure child processes are also killed
This commit is contained in:
parent
fb9b9fa65e
commit
a6ef4c8c50
|
@ -189,7 +189,7 @@ features cl = FeatureSet
|
||||||
|
|
||||||
startXmobar :: FIO (Process Handle () ())
|
startXmobar :: FIO (Process Handle () ())
|
||||||
startXmobar = do
|
startXmobar = do
|
||||||
p <- proc "xmobar" [] (startProcess . setStdin createPipe)
|
p <- proc "xmobar" [] (startProcess . setStdin createPipe . setCreateGroup True)
|
||||||
io $ hSetBuffering (getStdin p) LineBuffering
|
io $ hSetBuffering (getStdin p) LineBuffering
|
||||||
return p
|
return p
|
||||||
|
|
||||||
|
@ -263,8 +263,7 @@ runCleanup ts db = io $ do
|
||||||
killNoWait p = do
|
killNoWait p = do
|
||||||
let ph = unsafeProcessHandle p
|
let ph = unsafeProcessHandle p
|
||||||
i <- getPid ph
|
i <- getPid ph
|
||||||
forM_ i $ signalProcess sigTERM
|
forM_ i $ signalProcessGroup sigTERM
|
||||||
-- terminateProcess ph
|
|
||||||
stopNoWait p
|
stopNoWait p
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
|
@ -257,7 +257,7 @@ runNetAppDaemon cl = Sometimes "network applet" xpfVPN
|
||||||
where
|
where
|
||||||
tree = toAnd_ app $ Bus networkManagerPkgs networkManagerBus
|
tree = toAnd_ app $ Bus networkManagerPkgs networkManagerBus
|
||||||
app = DBusIO $ sysExe [Package Official "network-manager-applet"] "nm-applet"
|
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 :: Maybe SysClient -> SometimesX
|
||||||
runToggleBluetooth cl = Sometimes "bluetooth toggle" xpfBluetooth
|
runToggleBluetooth cl = Sometimes "bluetooth toggle" xpfBluetooth
|
||||||
|
|
|
@ -93,7 +93,7 @@ runAutolock = sometimesIO_ "automatic screen lock" "xss-lock" tree cmd
|
||||||
where
|
where
|
||||||
tree = And_ (Only_ $ sysExe [Package Official "xss-lock"] "xss-lock")
|
tree = And_ (Only_ $ sysExe [Package Official "xss-lock"] "xss-lock")
|
||||||
$ Only_ $ IOSometimes_ runScreenLock
|
$ Only_ $ IOSometimes_ runScreenLock
|
||||||
cmd = proc "xss-lock" ["--ignore-sleep", "screenlock"] startProcess
|
cmd = proc "xss-lock" ["--ignore-sleep", "screenlock"] (startProcess . setCreateGroup True)
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- | Confirmation prompts
|
-- | Confirmation prompts
|
||||||
|
|
Loading…
Reference in New Issue