gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r7705 - in GNUnet: contrib src/server


From: gnunet
Subject: [GNUnet-SVN] r7705 - in GNUnet: contrib src/server
Date: Sat, 13 Sep 2008 20:02:39 -0600 (MDT)

Author: grothoff
Date: 2008-09-13 20:02:39 -0600 (Sat, 13 Sep 2008)
New Revision: 7705

Modified:
   GNUnet/contrib/config-daemon.scm
   GNUnet/src/server/startup.c
   GNUnet/src/server/startup.h
Log:
fixing CPU limiter, see bug-gnunet e-mail

Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm    2008-09-13 14:34:34 UTC (rev 7704)
+++ GNUnet/contrib/config-daemon.scm    2008-09-14 02:02:39 UTC (rev 7705)
@@ -1392,6 +1392,20 @@
  (cons 0 999999999)
  'rare))
 
+
+(define (load-priority builder)
+ (builder
+ "LOAD"
+ "PRIORITY"
+ (_ "What priority should gnunetd use to run?")
+ (_ "You can specify priorities like NORMAL, ABOVE NORMAL, BELOW NORMAL, HIGH 
and IDLE or a numerical integer value (man nice).  The default is IDLE, which 
should result in gnunetd only using resources that would otherwise be idle.")
+ '()
+ #t
+ "IDLE"
+ '()
+ 'always))
+
+
 (define (load-padding builder)
  (builder
  "GNUNETD-EXPERIMENTAL"
@@ -1442,6 +1456,7 @@
   (_ "Load management")
   (nohelp)
   (list 
+    (load-priority builder)
     (load-maxdown builder)
     (load-maxup builder)
     (load-hard-up-limit builder)

Modified: GNUnet/src/server/startup.c
===================================================================
--- GNUnet/src/server/startup.c 2008-09-13 14:34:34 UTC (rev 7704)
+++ GNUnet/src/server/startup.c 2008-09-14 02:02:39 UTC (rev 7705)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001, 2002, 2004, 2005, 2006 Christian Grothoff (and other 
contributing authors)
+     (C) 2001, 2002, 2004, 2005, 2006, 2008 Christian Grothoff (and other 
contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -21,10 +21,6 @@
 /**
  * @file server/startup.c
  * @brief insignificant gnunetd helper methods
- *
- * Helper methods for the startup of gnunetd:
- * - PID file handling
- *
  * @author Christian Grothoff
  */
 
@@ -133,7 +129,15 @@
                                  struct GNUNET_GC_Configuration *cfg)
 {
   char *user;
+  char *prio;
 
+  if (0 == GNUNET_GC_get_configuration_value_string (cfg,
+                                                     "LOAD",
+                                                     "PRIORITY",
+                                                     "IDLE", &prio)
+      && strlen (prio))
+    GNUNET_set_process_priority(ectx, prio);     
+  GNUNET_free (prio);
   user = NULL;
   if (0 == GNUNET_GC_get_configuration_value_string (cfg,
                                                      "GNUNETD",

Modified: GNUnet/src/server/startup.h
===================================================================
--- GNUnet/src/server/startup.h 2008-09-13 14:34:34 UTC (rev 7704)
+++ GNUnet/src/server/startup.h 2008-09-14 02:02:39 UTC (rev 7705)
@@ -31,6 +31,9 @@
 #include "gnunet_util.h"
 #include "platform.h"
 
+/**
+ * Change our user/group id and adjust process priority.
+ */
 int GNUNET_CORE_startup_change_user (struct GNUNET_GE_Context *ectx,
                                      struct GNUNET_GC_Configuration *cfg);
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]