[Initng-svn] r3676 - in initng/trunk: plugins/cpout src

svn at initng.thinktux.net svn at initng.thinktux.net
Wed Apr 5 03:52:16 CEST 2006


Author: jimmy
Date: Wed Apr  5 03:52:14 2006
New Revision: 3676

Modified:
   initng/trunk/plugins/cpout/PLUGIN_DESCRIPTION
   initng/trunk/plugins/cpout/initng_colorprint_out.c
   initng/trunk/src/main.c
Log:
More fixes, to remove percent lines when system is not starting/stopping.


Modified: initng/trunk/plugins/cpout/PLUGIN_DESCRIPTION
==============================================================================
--- initng/trunk/plugins/cpout/PLUGIN_DESCRIPTION	(original)
+++ initng/trunk/plugins/cpout/PLUGIN_DESCRIPTION	Wed Apr  5 03:52:14 2006
@@ -3,6 +3,7 @@
   contributors : 
       commands : 
        options : 
+  cmd_line_opt : quiet_when_up
    description : This plugin show errormessages, status changes,
                  service output and system state changes directly
 		 on the console, by a colorfull output.
\ No newline at end of file

Modified: initng/trunk/plugins/cpout/initng_colorprint_out.c
==============================================================================
--- initng/trunk/plugins/cpout/initng_colorprint_out.c	(original)
+++ initng/trunk/plugins/cpout/initng_colorprint_out.c	Wed Apr  5 03:52:14 2006
@@ -56,28 +56,6 @@
     last_ptype = NULL;
 }
 
-/*
-   static void print_message(int percent, const char *service, const char *state, const char *extra)
-   {
-   if(percent)
-   {
-   if(extra)
-   printf(PE "\t[" C_GREEN "%s" C_OFF
-   "]\t%s\n", percent, service, state, extra);
-   else
-   printf(PE "\t[" C_GREEN "%s" C_OFF
-   "]\n", percent, service, state);
-   }
-   else
-   {
-   if(extra)
-   printf(P "\t[" C_GREEN "%s" C_OFF
-   "]\t%s\n", service, state, extra);
-   else
-   printf(P "\t[" C_GREEN "%s" C_OFF
-   "]\n", service, state);
-   }    
-   } */
 
 static void out_service_done(active_db_h * s)
 {
@@ -115,13 +93,24 @@
     t = MS_DIFF(s->time_current_state, s->time_last_state);
 
     clear_lastserv();
-    if (t > 1 && g.sys_state==STATE_STOPPING)
-        printf(PE "\t[" C_GREEN "%s" C_OFF
+    if (t > 1)
+    {
+	if(g.sys_state==STATE_STOPPING)
+    	    printf(PE "\t[" C_GREEN "%s" C_OFF
                "]\t( %s in %ims )\n", initng_active_db_percent_stopped(),
                s->name, is, is, t);
+	else
+    	    printf(P "\t[" C_GREEN "%s" C_OFF
+               "]\t( %s in %ims )\n", s->name, is, is, t);
+    }
     else
-        printf(PE "\t[" C_GREEN "%s" C_OFF "]\n",
+    {
+	if(g.sys_state==STATE_STOPPING)
+    	    printf(PE "\t[" C_GREEN "%s" C_OFF "]\n",
                initng_active_db_percent_stopped(), s->name, is);
+	else
+    	    printf(P "\t[" C_GREEN "%s" C_OFF "]\n", s->name, is);
+    }
 }
 
 
@@ -183,8 +172,7 @@
             return (TRUE);
 
         clear_lastserv();
-        printf(PE "\t[" C_GREEN "stopping" C_OFF "]\n",
-               initng_active_db_percent_stopped(), service->name);
+        printf(P "\t[" C_GREEN "stopping" C_OFF "]\n", service->name);
 
         return (TRUE);
     }

Modified: initng/trunk/src/main.c
==============================================================================
--- initng/trunk/src/main.c	(original)
+++ initng/trunk/src/main.c	Wed Apr  5 03:52:14 2006
@@ -467,6 +467,7 @@
 
     if (g.hot_reload)
     {
+	/* Mark service as up */
         retval = initng_plugin_callers_reload_active_db();
         if (retval != TRUE)
         {
@@ -478,6 +479,7 @@
             /* if the hot reload failed, we're probably in big trouble */
             initng_main_su_login();
         }
+	initng_main_set_sys_state(STATE_UP);
     }
 
     /* set title of initng, can be watched in ps -ax */
@@ -486,12 +488,13 @@
     /* Configure signal handlers */
     (void) initng_signal_enable();
 
-    /* change system state */
-    initng_main_set_sys_state(STATE_STARTING);
 
     /* make sure this is not a hot reload */
     if (!g.hot_reload)
     {
+	/* change system state */
+	initng_main_set_sys_state(STATE_STARTING);
+
         /* first start all services, prompted at boot with +daemon/test */
         initng_main_start_extra_services();
 


More information about the Initng-svn mailing list