67fbb903b6
The original pattern for creating the pid file was:
open_create(pid_file)
write(pid_file, pid)
close(pid_file)
But if a power outage occurs between open_create and write, the file will
be empty and httpd will refuse to start afterwards unless the corrupt pid
file is removed.
This patch uses the pattern:
open_create(temp_pid_file)
write(temp_pid_file)
close(temp_pid_file)
rename(temp_pid_file, pid_file)
which is guaranteed to be atomic, provided that temp_pid_file and pid_file
are located in the same file system, which this patch does by creating
a temporary file name with the pattern:
pid_file_name + random_suffix
Patch is upstream as of
|
||
---|---|---|
.. | ||
0001-cross-compile.patch | ||
0002-nios2_is_not_os2.patch | ||
0003-server-Makefile.in-handle-separate-APR_INCLUDE_DIR-A.patch | ||
0004-server-log.c-ap_log_pid-Use-a-temporary-file-then-re.patch | ||
apache.hash | ||
apache.mk | ||
apache.service | ||
Config.in | ||
S50apache |