/[pdpsoft]/trunk/grid-mw-security/ees/src/eef/eef_common.c
ViewVC logotype

Contents of /trunk/grid-mw-security/ees/src/eef/eef_common.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1068 - (show annotations) (download) (as text)
Mon Nov 9 10:19:47 2009 UTC (12 years, 2 months ago) by aramv
File MIME type: text/x-chdr
File size: 1745 byte(s)
Worked on log levels
1 #include "eef.h"
2 #include "pdl.h"
3 #include "plugin_manager.h"
4
5 static const char* _modules_path; /*! Holds the global path to plug-in modules */
6
7 /*! Try to initialize the AOS, enable logging, debugging, initialize the plug-in manager and try to parse the config file and ascertain the module path
8 *
9 */
10 EES_RC EEF_Init(char *config_file){
11 openlog ("ees", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON);
12 #if ENABLE_DEBUG
13 eef_log(LOG_INFO, "DEBUG MODE ENABLED\n");
14 #else
15 setlogmask (LOG_UPTO(LOG_INFO));
16 #endif
17
18 if (AOS_Init() == EES_SUCCESS){
19 if(startPluginManager() == EES_SUCCESS){
20 eef_log(LOG_NOTICE, "Loading config file: %s\n", config_file);
21 if(pdl_init(config_file) == EES_SUCCESS){
22 /* after the config file was successfully read, we can try to set the modules path if one was provided */
23 eef_log(LOG_NOTICE, "Loaded config file: %s\n", config_file);
24 _modules_path = get_pdl_path();
25 if(strlen(_modules_path) > 0){
26 eef_log(LOG_NOTICE, "Using new modules path: %s\n", _modules_path);
27 } else {
28 _modules_path = MODULE_DIR;
29 }
30 return EES_SUCCESS;
31 }
32 }
33 }
34 return EES_FAILURE;
35 }
36
37 /*!
38 * Terminates the parser, stops the plug-in manager, terminates the AOS and closes the log.
39 */
40 EES_RC EEF_Term(){
41 eef_log(LOG_INFO, "Cleaning up...");
42 if((pdl_term() == EES_SUCCESS) &&
43 (stopPluginManager() == EES_SUCCESS) &&
44 (AOS_Term() == EES_SUCCESS)){
45 closelog();
46 return EES_SUCCESS;
47 }
48 eef_log(LOG_ERR, "Errors detected\n");
49 closelog();
50 return EES_FAILURE;
51 }
52
53 /*!
54 * Returns the global modules path to load plug-ins from
55 */
56 const char* get_modules_path(void){
57 return _modules_path;
58 }

Properties

Name Value
svn:mergeinfo

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28