Patch for nagios.c/embedded Perl support: HUP no longer calls init_embedded_perl() and friends.

Ethan Galstad nagios at nagios.org
Thu May 26 05:25:11 CEST 2005


Thanks - will be in CVS soon.

On 20 May 2005 at 14:14, Stanley Hopcroft wrote:

> 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> 
> 
> 
> 



Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org



-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click




More information about the Developers mailing list