svn commit: samba r7964 - in trunk/source/smbd: .

idra at samba.org idra at samba.org
Mon Jun 27 23:22:59 GMT 2005


Author: idra
Date: 2005-06-27 23:22:59 +0000 (Mon, 27 Jun 2005)
New Revision: 7964

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7964

Log:

merge from 3.0


Modified:
   trunk/source/smbd/process.c


Changeset:
Modified: trunk/source/smbd/process.c
===================================================================
--- trunk/source/smbd/process.c	2005-06-27 22:53:56 UTC (rev 7963)
+++ trunk/source/smbd/process.c	2005-06-27 23:22:59 UTC (rev 7964)
@@ -1302,6 +1302,7 @@
 
 void check_reload(int t)
 {
+	static pid_t mypid = 0;
 	static time_t last_smb_conf_reload_time = 0;
 	static time_t last_printer_reload_time = 0;
 	time_t printcap_cache_time = (time_t)lp_printcap_cache_time();
@@ -1317,6 +1318,15 @@
 			last_printer_reload_time = t;
 	}
 
+	if (mypid != getpid()) { /* First time or fork happened meanwhile */
+		/* randomize over 60 second the printcap reload to avoid all
+		 * process hitting cupsd at the same time */
+		int time_range = 60;
+
+		last_printer_reload_time += random() % time_range;
+		mypid = getpid();
+	}
+
 	if (reload_after_sighup || (t >= last_smb_conf_reload_time+SMBD_RELOAD_CHECK)) {
 		reload_services(True);
 		reload_after_sighup = False;



More information about the samba-cvs mailing list