Solved Apache24 Graceful Restart

FreeBSD 13.3-RELEASE-p3
Apache24 2.4.62
PHP 8.2.22

For the last 3 days any attempt to gracefully restart Apache24 whether it's every day at midnight via newsyslog or via the CLI using either service apache24 graceful or apachectl graceful results in Apache24 just stopping. I can manually start it again without any issues.

I changed the loglevel of Apache24 to debug which yielded no errors after starting it again but note the "Unclean shutdown" ...


Code:
[Sun Aug 11 12:12:31.923304 2024] [mpm_prefork:notice] [pid 51144] AH00171: Graceful restart requested, doing restart
[Sun Aug 11 12:13:54.944735 2024] [core:warn] [pid 60082] AH00098: pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?


My concern here is the log rotation at midnight seems to run but Apache24 fails to restart and as what happened this morning I had to manually start it again some 10 hours of it being stopped.

Any ideas here?
 
Same result ...

Code:
[Sun Aug 11 14:35:39.675291 2024] [mpm_prefork:notice] [pid 2467] AH00173: SIGHUP received.  Attempting to restart
[Sun Aug 11 14:35:39.689301 2024] [ssl:info] [pid 2467] AH01883: Init: Initialized OpenSSL library
[Sun Aug 11 14:35:39.689336 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(414): AH00821: shmcb_init allocated 128000 bytes of shared memory
[Sun Aug 11 14:35:39.689340 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(428): AH00822: for 127912 bytes (128000 including header), recommending 4 subcaches, 21 indexes each
[Sun Aug 11 14:35:39.689343 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(465): AH00824: shmcb_init_memory choices follow
[Sun Aug 11 14:35:39.689345 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(467): AH00825: subcache_num = 4
[Sun Aug 11 14:35:39.689347 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(469): AH00826: subcache_size = 31976
[Sun Aug 11 14:35:39.689349 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(471): AH00827: subcache_data_offset = 520
[Sun Aug 11 14:35:39.689351 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(473): AH00828: subcache_data_size = 31456
[Sun Aug 11 14:35:39.689353 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(475): AH00829: index_num = 21
[Sun Aug 11 14:35:39.689359 2024] [socache_shmcb:info] [pid 2467] AH00830: Shared memory socache initialised
[Sun Aug 11 14:35:39.689364 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(414): AH00821: shmcb_init allocated 512000 bytes of shared memory
[Sun Aug 11 14:35:39.689366 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(428): AH00822: for 511912 bytes (512000 including header), recommending 32 subcaches, 88 indexes each
[Sun Aug 11 14:35:39.689368 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(465): AH00824: shmcb_init_memory choices follow
[Sun Aug 11 14:35:39.689370 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(467): AH00825: subcache_num = 32
[Sun Aug 11 14:35:39.689372 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(469): AH00826: subcache_size = 15992
[Sun Aug 11 14:35:39.689374 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(471): AH00827: subcache_data_offset = 2128
[Sun Aug 11 14:35:39.689376 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(473): AH00828: subcache_data_size = 13864
[Sun Aug 11 14:35:39.689378 2024] [socache_shmcb:debug] [pid 2467] mod_socache_shmcb.c(475): AH00829: index_num = 88
[Sun Aug 11 14:35:39.689417 2024] [socache_shmcb:info] [pid 2467] AH00830: Shared memory socache initialised
[Sun Aug 11 14:35:39.689419 2024] [ssl:info] [pid 2467] AH01887: Init: Initializing (virtual) servers for SSL
[Sun Aug 11 14:35:39.691873 2024] [ssl:info] [pid 2467] AH01876: mod_ssl/2.4.62 compiled against Server: Apache/2.4.62, Library: OpenSSL/1.1.1w-freebsd
[Sun Aug 11 14:36:03.685092 2024] [ssl:info] [pid 2983] AH01883: Init: Initialized OpenSSL library
[Sun Aug 11 14:36:03.685267 2024] [ssl:info] [pid 2983] AH01887: Init: Initializing (virtual) servers for SSL
[Sun Aug 11 14:36:03.688025 2024] [ssl:info] [pid 2983] AH01876: mod_ssl/2.4.62 compiled against Server: Apache/2.4.62, Library: OpenSSL/1.1.1w-freebsd
[Sun Aug 11 14:36:03.699118 2024] [ssl:info] [pid 2984] AH01883: Init: Initialized OpenSSL library
[Sun Aug 11 14:36:03.699170 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(414): AH00821: shmcb_init allocated 128000 bytes of shared memory
[Sun Aug 11 14:36:03.699174 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(428): AH00822: for 127912 bytes (128000 including header), recommending 4 subcaches, 21 indexes each
[Sun Aug 11 14:36:03.699177 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(465): AH00824: shmcb_init_memory choices follow
[Sun Aug 11 14:36:03.699179 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(467): AH00825: subcache_num = 4
[Sun Aug 11 14:36:03.699181 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(469): AH00826: subcache_size = 31976
[Sun Aug 11 14:36:03.699183 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(471): AH00827: subcache_data_offset = 520
[Sun Aug 11 14:36:03.699185 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(473): AH00828: subcache_data_size = 31456
[Sun Aug 11 14:36:03.699187 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(475): AH00829: index_num = 21
[Sun Aug 11 14:36:03.699194 2024] [socache_shmcb:info] [pid 2984] AH00830: Shared memory socache initialised
[Sun Aug 11 14:36:03.699199 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(414): AH00821: shmcb_init allocated 512000 bytes of shared memory
[Sun Aug 11 14:36:03.699201 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(428): AH00822: for 511912 bytes (512000 including header), recommending 32 subcaches, 88 indexes each
[Sun Aug 11 14:36:03.699203 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(465): AH00824: shmcb_init_memory choices follow
[Sun Aug 11 14:36:03.699205 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(467): AH00825: subcache_num = 32
[Sun Aug 11 14:36:03.699207 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(469): AH00826: subcache_size = 15992
[Sun Aug 11 14:36:03.699209 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(471): AH00827: subcache_data_offset = 2128
[Sun Aug 11 14:36:03.699211 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(473): AH00828: subcache_data_size = 13864
[Sun Aug 11 14:36:03.699213 2024] [socache_shmcb:debug] [pid 2984] mod_socache_shmcb.c(475): AH00829: index_num = 88
[Sun Aug 11 14:36:03.699251 2024] [socache_shmcb:info] [pid 2984] AH00830: Shared memory socache initialised
[Sun Aug 11 14:36:03.699254 2024] [ssl:info] [pid 2984] AH01887: Init: Initializing (virtual) servers for SSL
[Sun Aug 11 14:36:03.701796 2024] [ssl:info] [pid 2984] AH01876: mod_ssl/2.4.62 compiled against Server: Apache/2.4.62, Library: OpenSSL/1.1.1w-freebsd
[Sun Aug 11 14:36:03.722320 2024] [core:warn] [pid 2984] AH00098: pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun Aug 11 14:36:03.724654 2024] [mpm_prefork:notice] [pid 2984] AH00163: Apache/2.4.62 (FreeBSD) OpenSSL/1.1.1w-freebsd PHP/8.2.22 configured -- resuming normal operations
[Sun Aug 11 14:36:03.724685 2024] [mpm_prefork:info] [pid 2984] AH00164: Server built: unknown
[Sun Aug 11 14:36:03.724696 2024] [core:notice] [pid 2984] AH00094: Command line: '/usr/local/sbin/httpd'
[Sun Aug 11 14:36:03.724698 2024] [core:debug] [pid 2984] log.c(1605): AH02639: Using SO_REUSEPORT: no (1)
[Sun Aug 11 14:36:03.724701 2024] [mpm_prefork:debug] [pid 2984] prefork.c(970): AH00165: Accept mutex: flock (default: flock)
 
Well it seems I got lucky. I had to add apache24_aslr_disable="yes" to rc.conf and move LoadModule php_module libexec/apache24/libphp.so to the top of httpd.conf as per this article ...

PR 268318

Quite why though it all of a sudden decided to cause this I have no idea.
 
Back
Top