internal: prevent early exit processes from being zombies (#11995)
Prevent `exec`/`exec-once` processes which terminate very early (before Hyprland declares that it does not want to reap zombies) from getting stuck as zombie processes.
This commit is contained in:
parent
32f3233324
commit
da31e82aab
3 changed files with 7 additions and 2 deletions
|
|
@ -194,6 +194,10 @@ static bool test() {
|
||||||
EXPECT_CONTAINS(str, "fullscreen: 2");
|
EXPECT_CONTAINS(str, "fullscreen: 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that the process autostarted in the config does not
|
||||||
|
// become a zombie even if it terminates very quickly.
|
||||||
|
EXPECT(Tests::execAndGet("pgrep -f 'sleep 0'").empty(), true);
|
||||||
|
|
||||||
// kill all
|
// kill all
|
||||||
NLog::log("{}Killing all windows", Colors::YELLOW);
|
NLog::log("{}Killing all windows", Colors::YELLOW);
|
||||||
Tests::killAllWindows();
|
Tests::killAllWindows();
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ $menu = wofi --show drun
|
||||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||||
# Or execute your favorite apps at launch like this:
|
# Or execute your favorite apps at launch like this:
|
||||||
|
|
||||||
|
exec-once = sleep 0 # Terminates very quickly
|
||||||
# exec-once = $terminal
|
# exec-once = $terminal
|
||||||
# exec-once = nm-applet &
|
# exec-once = nm-applet &
|
||||||
# exec-once = waybar & hyprpaper & firefox
|
# exec-once = waybar & hyprpaper & firefox
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,8 @@ int main(int argc, char** argv) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reapZombieChildrenAutomatically();
|
||||||
|
|
||||||
g_pCompositor->initServer(socketName, socketFd);
|
g_pCompositor->initServer(socketName, socketFd);
|
||||||
|
|
||||||
if (verifyConfig)
|
if (verifyConfig)
|
||||||
|
|
@ -195,8 +197,6 @@ int main(int argc, char** argv) {
|
||||||
if (!envEnabled("HYPRLAND_NO_RT"))
|
if (!envEnabled("HYPRLAND_NO_RT"))
|
||||||
NInit::gainRealTime();
|
NInit::gainRealTime();
|
||||||
|
|
||||||
reapZombieChildrenAutomatically();
|
|
||||||
|
|
||||||
Debug::log(LOG, "Hyprland init finished.");
|
Debug::log(LOG, "Hyprland init finished.");
|
||||||
|
|
||||||
// If all's good to go, start.
|
// If all's good to go, start.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue