diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-12-12 13:28:06 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-12-12 13:28:06 +0000 |
commit | ae95d2cfa0d571bde89af7b6712c4f348e193232 (patch) | |
tree | 220d444020575597420f9e322e81e2e6c9458367 /src/sysmon | |
parent | 3d8ac9f662a774b08229e38fbe1e460e12aa584c (diff) | |
download | gnunet-ae95d2cfa0d571bde89af7b6712c4f348e193232.tar.gz gnunet-ae95d2cfa0d571bde89af7b6712c4f348e193232.zip |
changes
Diffstat (limited to 'src/sysmon')
-rw-r--r-- | src/sysmon/Makefile.am | 8 | ||||
-rw-r--r-- | src/sysmon/gnunet-service-sysmon.c (renamed from src/sysmon/gnunet-daemon-sysmon.c) | 55 | ||||
-rw-r--r-- | src/sysmon/sysmon.conf.in | 2 |
3 files changed, 39 insertions, 26 deletions
diff --git a/src/sysmon/Makefile.am b/src/sysmon/Makefile.am index dd9c24691..0e87a627f 100644 --- a/src/sysmon/Makefile.am +++ b/src/sysmon/Makefile.am | |||
@@ -16,16 +16,16 @@ if USE_COVERAGE | |||
16 | endif | 16 | endif |
17 | 17 | ||
18 | libexec_PROGRAMS = \ | 18 | libexec_PROGRAMS = \ |
19 | gnunet_daemon_sysmon | 19 | gnunet_service_sysmon |
20 | 20 | ||
21 | check_PROGRAMS = \ | 21 | check_PROGRAMS = \ |
22 | test_glibtop \ | 22 | test_glibtop \ |
23 | test_glibtop_process \ | 23 | test_glibtop_process \ |
24 | test_glibtop_network | 24 | test_glibtop_network |
25 | 25 | ||
26 | gnunet_daemon_sysmon_SOURCES = \ | 26 | gnunet_service_sysmon_SOURCES = \ |
27 | gnunet-daemon-sysmon.c | 27 | gnunet-service-sysmon.c |
28 | gnunet_daemon_sysmon_LDADD = \ | 28 | gnunet_service_sysmon_LDADD = \ |
29 | $(top_builddir)/src/util/libgnunetutil.la \ | 29 | $(top_builddir)/src/util/libgnunetutil.la \ |
30 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 30 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
31 | $(GN_LIBINTL) | 31 | $(GN_LIBINTL) |
diff --git a/src/sysmon/gnunet-daemon-sysmon.c b/src/sysmon/gnunet-service-sysmon.c index 3fb0fdd5a..32b4ccbed 100644 --- a/src/sysmon/gnunet-daemon-sysmon.c +++ b/src/sysmon/gnunet-service-sysmon.c | |||
@@ -19,8 +19,8 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file sysmon/gnunet-daemon-sysmon.c | 22 | * @file sysmon/gnunet-service-sysmon.c |
23 | * @brief system monitoring daemon | 23 | * @brief system monitoring service |
24 | * @author Matthias Wachs | 24 | * @author Matthias Wachs |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
@@ -508,18 +508,40 @@ run_properties (void) | |||
508 | return GNUNET_OK; | 508 | return GNUNET_OK; |
509 | } | 509 | } |
510 | 510 | ||
511 | |||
512 | /** | ||
513 | * Task run during shutdown. | ||
514 | * | ||
515 | * @param cls unused | ||
516 | * @param tc unused | ||
517 | */ | ||
518 | static void | ||
519 | cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
520 | { | ||
521 | /* FIXME: do clean up here */ | ||
522 | } | ||
523 | |||
524 | |||
511 | /** | 525 | /** |
512 | * Main function that will be run by the scheduler. | 526 | * Process template requests. |
513 | * | 527 | * |
514 | * @param cls closure | 528 | * @param cls closure |
515 | * @param args remaining command-line arguments | 529 | * @param server the initialized server |
516 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | 530 | * @param cfg configuration to use |
517 | * @param cfg configuration | ||
518 | */ | 531 | */ |
519 | static void | 532 | static void |
520 | run (void *cls, char *const *args, const char *cfgfile, | 533 | run (void *cls, struct GNUNET_SERVER_Handle *server, |
521 | const struct GNUNET_CONFIGURATION_Handle *mycfg) | 534 | const struct GNUNET_CONFIGURATION_Handle *mycfg) |
522 | { | 535 | { |
536 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { | ||
537 | /* FIXME: add handlers here! */ | ||
538 | {NULL, NULL, 0, 0} | ||
539 | }; | ||
540 | /* FIXME: do setup here */ | ||
541 | GNUNET_SERVER_add_handlers (server, handlers); | ||
542 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, | ||
543 | NULL); | ||
544 | |||
523 | struct GNUNET_CONFIGURATION_Handle *properties; | 545 | struct GNUNET_CONFIGURATION_Handle *properties; |
524 | char *file; | 546 | char *file; |
525 | 547 | ||
@@ -590,7 +612,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
590 | 612 | ||
591 | 613 | ||
592 | /** | 614 | /** |
593 | * The main function. | 615 | * The main function for the template service. |
594 | * | 616 | * |
595 | * @param argc number of arguments from the command line | 617 | * @param argc number of arguments from the command line |
596 | * @param argv command line arguments | 618 | * @param argv command line arguments |
@@ -599,18 +621,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
599 | int | 621 | int |
600 | main (int argc, char *const *argv) | 622 | main (int argc, char *const *argv) |
601 | { | 623 | { |
602 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 624 | return (GNUNET_OK == |
603 | GNUNET_GETOPT_OPTION_END | 625 | GNUNET_SERVICE_run (argc, argv, "sysmon", |
604 | }; | 626 | GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1; |
605 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | ||
606 | return 2; | ||
607 | |||
608 | ret = (GNUNET_OK == | ||
609 | GNUNET_PROGRAM_run (argc, argv, "gnunet-daemon-sysmon", | ||
610 | gettext_noop ("GNUnet system monitoring and information daemon"), options, &run, | ||
611 | NULL)) ? ret : 1; | ||
612 | GNUNET_free ((void*) argv); | ||
613 | return ret; | ||
614 | } | 627 | } |
615 | 628 | ||
616 | /* end of gnunet-daemon-sysmon.c */ | 629 | /* end of gnunet-service-sysmon.c */ |
diff --git a/src/sysmon/sysmon.conf.in b/src/sysmon/sysmon.conf.in index b5c4c7355..238f4e2ae 100644 --- a/src/sysmon/sysmon.conf.in +++ b/src/sysmon/sysmon.conf.in | |||
@@ -5,4 +5,4 @@ HOSTNAME = localhost | |||
5 | HOME = $SERVICEHOME | 5 | HOME = $SERVICEHOME |
6 | BINARY = gnunet-daemon-sysmon | 6 | BINARY = gnunet-daemon-sysmon |
7 | CFGFILE = sysmon-properties.conf | 7 | CFGFILE = sysmon-properties.conf |
8 | UNIXPATH = /tmp/gnunet-daemon-sysmon.sock | 8 | UNIXPATH = /tmp/gnunet-service-sysmon.sock |