mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +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);
|
||||
} else {
|
||||
// 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