Patch for nagios.c/embedded Perl support: HUP no longer calls init_embedded_perl() and friends.
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.gov.au
Fri May 20 06:14:53 CEST 2005
Dear Folks,
Please find below a patch against the 2.x CVS of the last 10 days.
The object is embedded Perl support.
The intent is to avoid the
1 surge of memory use by the Nagios process
2 increased rate of memory use by the Nagios process
after sending a hangup signal.
Prior to this patch, I would reconfigure and then activate the changes
by a restart (stop/start).
The patched code does not call init_embedded_per() and
deinit_embedded_perl() when sigrestart is true (set by the HUP
sighandler in utils.c).
A patched copy has been running here for the last 24 hours and been
hupped a few times in that period.
Yours sincerely.
tsitc> diff -u nagios.c.orig nagios.c
--- nagios.c.orig Thu May 19 22:25:29 2005
+++ nagios.c Thu May 19 22:28:11 2005
@@ -576,7 +576,8 @@
/* initialize embedded Perl interpreter */
#ifdef EMBEDDEDPERL
- init_embedded_perl(env);
+ if(sigrestart==FALSE)
+ init_embedded_perl(env);
#else
init_embedded_perl(NULL);
#endif
@@ -721,7 +722,8 @@
close_command_file();
/* cleanup embedded perl interpreter */
- deinit_embedded_perl();
+ if(sigrestart==FALSE)
+ deinit_embedded_perl();
/* cleanup worker threads */
shutdown_service_result_worker_thread();
tsitc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: disclaimer.txt
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20050520/3114f7f8/attachment.txt>
More information about the Developers
mailing list