[Initng-svn] r2927 - in initng: . devtool plugins plugins/service
src
svn at initng.thinktux.net
svn at initng.thinktux.net
Wed Feb 1 12:33:42 CET 2006
Author: jimmy
Date: Wed Feb 1 12:33:42 2006
New Revision: 2927
Added:
initng/plugins/service/
initng/plugins/service/Makefile.am
initng/plugins/service/initng_service.c
initng/plugins/service/initng_service.h
initng/src/initng_depend.c
initng/src/initng_depend.h
Modified:
initng/configure.in
initng/devtool/test_parser.c
initng/plugins/Makefile.am
initng/src/Makefile.am
initng/src/initng_active_state.c
initng/src/initng_static_process_types.c
initng/src/initng_static_process_types.h
initng/src/initng_static_service_types.c
initng/src/initng_static_service_types.h
initng/src/initng_static_states.c
Log:
The first part, of a huge internal change.
Now all types like service daemons, virtuals and so on, is moved to plugins.
First out is plugins/service
Modified: initng/configure.in
==============================================================================
--- initng/configure.in (original)
+++ initng/configure.in Wed Feb 1 12:33:42 2006
@@ -423,6 +423,7 @@
plugins/reload/Makefile \
plugins/history/Makefile \
plugins/syslog/Makefile \
+ plugins/service/Makefile \
plugins/respawn/Makefile \
plugins/unneeded/Makefile \
plugins/last/Makefile \
Modified: initng/devtool/test_parser.c
==============================================================================
--- initng/devtool/test_parser.c (original)
+++ initng/devtool/test_parser.c Wed Feb 1 12:33:42 2006
@@ -305,7 +305,7 @@
SPACE;
printf("%s - failed\n", name);
}
- service = initng_service_cache_new(name, &TYPE_SERVICE);
+ service = initng_service_cache_new(name, initng_service_types_get("service"));
if (service)
{
initng_service_cache_add(service);
Modified: initng/plugins/Makefile.am
==============================================================================
--- initng/plugins/Makefile.am (original)
+++ initng/plugins/Makefile.am Wed Feb 1 12:33:42 2006
@@ -1,5 +1,5 @@
-SUBDIRS=
+SUBDIRS=service
if BUILD_ALSO
SUBDIRS+=also
Modified: initng/src/Makefile.am
==============================================================================
--- initng/src/Makefile.am (original)
+++ initng/src/Makefile.am Wed Feb 1 12:33:42 2006
@@ -32,6 +32,8 @@
initng_common.h \
initng_control_command.c \
initng_control_command.h \
+ initng_depend.c \
+ initng_depend.h \
initng_error.c \
initng_error.h \
initng_execute.c \
Modified: initng/src/initng_active_state.c
==============================================================================
--- initng/src/initng_active_state.c (original)
+++ initng/src/initng_active_state.c Wed Feb 1 12:33:42 2006
@@ -34,7 +34,7 @@
/* look for duplets */
if (initng_active_state_find(state->state_name) != NULL)
{
- F_("There exists a state with this state_name already, please check this!\n");
+ F_("There exists a state with this state_name (%s) already, please check this!\n", state->state_name);
return (FALSE);
}
Modified: initng/src/initng_static_process_types.c
==============================================================================
--- initng/src/initng_static_process_types.c (original)
+++ initng/src/initng_static_process_types.c Wed Feb 1 12:33:42 2006
@@ -47,15 +47,15 @@
process_h * process);
-ptype_h T_START = { "start", &handle_killed_start };
-ptype_h T_STOP = { "stop", &handle_killed_stop };
+/*ptype_h T_START = { "start", &handle_killed_start };
+ ptype_h T_STOP = { "stop", &handle_killed_stop };*/
ptype_h T_DAEMON = { "daemon", &handle_killed_daemon };
ptype_h T_KILL = { "kill", NULL };
void initng_static_process_types_add_default(void)
{
- initng_process_db_ptype_add(&T_START);
- initng_process_db_ptype_add(&T_STOP);
+/* initng_process_db_ptype_add(&T_START);
+ initng_process_db_ptype_add(&T_STOP);*/
initng_process_db_ptype_add(&T_DAEMON);
initng_process_db_ptype_add(&T_KILL);
}
@@ -97,6 +97,7 @@
initng_common_mark_service(service, &STOPPED);
}
+#ifdef NONO
/*
* handle_killed_start(), description:
*
@@ -192,3 +193,4 @@
/* mark service stopped */
initng_common_mark_service(service, &STOPPED);
}
+#endif
Modified: initng/src/initng_static_process_types.h
==============================================================================
--- initng/src/initng_static_process_types.h (original)
+++ initng/src/initng_static_process_types.h Wed Feb 1 12:33:42 2006
@@ -24,8 +24,8 @@
#include "initng.h"
#include "initng_process_db.h"
-extern ptype_h T_START;
-extern ptype_h T_STOP;
+/* extern ptype_h T_START;
+ extern ptype_h T_STOP; */
extern ptype_h T_DAEMON;
extern ptype_h T_KILL;
Modified: initng/src/initng_static_service_types.c
==============================================================================
--- initng/src/initng_static_service_types.c (original)
+++ initng/src/initng_static_service_types.c Wed Feb 1 12:33:42 2006
@@ -51,7 +51,7 @@
static int start_DAEMON_or_SERVICE(active_db_h * service_to_start);
static int stop_SERVICE_or_DAEMON(active_db_h * service_to_stop);
-stype_h TYPE_SERVICE = { "service", &start_DAEMON_or_SERVICE, &stop_SERVICE_or_DAEMON, NULL };
+/*stype_h TYPE_SERVICE = { "service", &start_DAEMON_or_SERVICE, &stop_SERVICE_or_DAEMON, NULL };*/
stype_h TYPE_DAEMON = { "daemon", &start_DAEMON_or_SERVICE, &stop_SERVICE_or_DAEMON, NULL };
stype_h TYPE_VIRTUAL = { "virtual", &start_DAEMON_or_SERVICE, &stop_SERVICE_or_DAEMON, NULL };
stype_h TYPE_RUNLEVEL = { "runlevel", &start_DAEMON_or_SERVICE, &stop_SERVICE_or_DAEMON, NULL };
@@ -59,7 +59,7 @@
void initng_service_add_static_stypes(void)
{
- initng_service_types_add(&TYPE_SERVICE);
+/* initng_service_types_add(&TYPE_SERVICE);*/
initng_service_types_add(&TYPE_DAEMON);
initng_service_types_add(&TYPE_VIRTUAL);
initng_service_types_add(&TYPE_RUNLEVEL);
Modified: initng/src/initng_static_service_types.h
==============================================================================
--- initng/src/initng_static_service_types.h (original)
+++ initng/src/initng_static_service_types.h Wed Feb 1 12:33:42 2006
@@ -25,7 +25,7 @@
#include <time.h>
#include "initng_active_db.h"
-extern stype_h TYPE_SERVICE;
+/* extern stype_h TYPE_SERVICE;*/
extern stype_h TYPE_DAEMON;
extern stype_h TYPE_VIRTUAL;
extern stype_h TYPE_RUNLEVEL;
Modified: initng/src/initng_static_states.c
==============================================================================
--- initng/src/initng_static_states.c (original)
+++ initng/src/initng_static_states.c Wed Feb 1 12:33:42 2006
@@ -201,10 +201,12 @@
static void handle_START_DEP_MET_service(active_db_h * service_to_start)
{
+#ifdef NONO
if (!initng_common_mark_service(service_to_start, &STARTING))
return;
/* F I N A L L Y S T A R T */
+
switch (initng_execute_launch(service_to_start, &T_START))
{
case FALSE:
@@ -215,6 +217,7 @@
default:
return;
}
+#endif
}
static void handle_START_DEP_MET(active_db_h * service_to_start)
@@ -233,11 +236,12 @@
initng_common_mark_service(service_to_start, &DONE);
return;
}
+/*
else if (service_to_start->type == &TYPE_SERVICE)
{
handle_START_DEP_MET_service(service_to_start);
return;
- }
+ }*/
else if (service_to_start->type == &TYPE_DAEMON)
{
handle_START_DEP_MET_daemon(service_to_start);
@@ -317,6 +321,7 @@
static void handle_STOP_DEP_MET_service(active_db_h * service_to_stop)
{
+#ifdef NONO
/* mark this service as STOPPING */
initng_common_mark_service(service_to_stop, &STOPPING);
@@ -344,6 +349,7 @@
}
return;
}
+#endif
}
static void handle_STOP_DEP_MET_daemon(active_db_h * service_to_stop)
@@ -403,12 +409,13 @@
static void handle_STOP_DEP_MET(active_db_h * service_to_stop)
{
+/*
if (service_to_stop->type == &TYPE_SERVICE)
{
handle_STOP_DEP_MET_service(service_to_stop);
return;
}
-
+*/
if (service_to_stop->type == &TYPE_DAEMON)
{
handle_STOP_DEP_MET_daemon(service_to_stop);
More information about the Initng-svn
mailing list