mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
icingacli web serve: redirect standard I/O to /dev/null after fork(2)
This commit is contained in:
parent
8e84bdf4f5
commit
59708bb0f7
@ -85,6 +85,17 @@ class WebCommand extends Command
|
|||||||
// pcntl_wait($status);
|
// pcntl_wait($status);
|
||||||
} else {
|
} else {
|
||||||
// child
|
// child
|
||||||
|
|
||||||
|
// Replace console with /dev/null by first freeing the (lowest possible) FDs 0, 1 and 2
|
||||||
|
// and then opening /dev/null once for every one of them (open(2) chooses the lowest free FD).
|
||||||
|
|
||||||
|
fclose(STDIN);
|
||||||
|
fclose(STDOUT);
|
||||||
|
fclose(STDERR);
|
||||||
|
|
||||||
|
fopen('/dev/null', 'rb');
|
||||||
|
fopen('/dev/null', 'wb');
|
||||||
|
fopen('/dev/null', 'wb');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user