aboutsummaryrefslogtreecommitdiff
path: root/src/arm
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-09 10:05:42 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-09 10:05:42 +0000
commit2032baa561c7fefbe2605f5d6b979a295a61637d (patch)
tree2c2a2f1c92940a51ccb565c8fdc1b381a68d8bb4 /src/arm
parent0f6f7fdb0ee4172951f8cb1431d2e457a4b83716 (diff)
downloadgnunet-2032baa561c7fefbe2605f5d6b979a295a61637d.tar.gz
gnunet-2032baa561c7fefbe2605f5d6b979a295a61637d.zip
migrating towards XDG configuration specification (#3000)
Diffstat (limited to 'src/arm')
-rw-r--r--src/arm/arm.conf.in3
-rw-r--r--src/arm/gnunet-arm.c22
-rw-r--r--src/arm/test_arm_api_data.conf1
3 files changed, 13 insertions, 13 deletions
diff --git a/src/arm/arm.conf.in b/src/arm/arm.conf.in
index b9a33242f..1b079c98c 100644
--- a/src/arm/arm.conf.in
+++ b/src/arm/arm.conf.in
@@ -2,7 +2,6 @@
2[arm] 2[arm]
3@UNIXONLY@ PORT = 2087 3@UNIXONLY@ PORT = 2087
4HOSTNAME = localhost 4HOSTNAME = localhost
5HOME = $SERVICEHOME
6BINARY = gnunet-service-arm 5BINARY = gnunet-service-arm
7ACCEPT_FROM = 127.0.0.1; 6ACCEPT_FROM = 127.0.0.1;
8ACCEPT_FROM6 = ::1; 7ACCEPT_FROM6 = ::1;
@@ -16,7 +15,7 @@ UNIX_MATCH_GID = YES
16# service. Thus the following option would introduce per-service 15# service. Thus the following option would introduce per-service
17# logging with a new log file each day. Note that only the last 3 16# logging with a new log file each day. Note that only the last 3
18# log files are preserved. 17# log files are preserved.
19# GLOBAL_POSTFIX = -l $SERVICEHOME/{}-%Y-%m-%d.log 18# GLOBAL_POSTFIX = -l $GNUNET_CACHE_HOME/{}-%Y-%m-%d.log
20GLOBAL_PREFIX = @MONKEYPREFIX@ 19GLOBAL_PREFIX = @MONKEYPREFIX@
21# USERNAME = 20# USERNAME =
22# MAXBUF = 21# MAXBUF =
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index 80d3e9c03..a492fac5b 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -147,7 +147,7 @@ static unsigned int no_stderr;
147 147
148 148
149/** 149/**
150 * Attempts to delete configuration file and SERVICEHOME 150 * Attempts to delete configuration file and GNUNET_HOME
151 * on ARM shutdown provided the end and delete options 151 * on ARM shutdown provided the end and delete options
152 * were specified when gnunet-arm was run. 152 * were specified when gnunet-arm was run.
153 */ 153 */
@@ -158,15 +158,17 @@ delete_files ()
158 "Will attempt to remove configuration file %s and service directory %s\n", 158 "Will attempt to remove configuration file %s and service directory %s\n",
159 config_file, dir); 159 config_file, dir);
160 160
161 if (UNLINK (config_file) != 0) 161 if (0 != UNLINK (config_file))
162 { 162 {
163 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 163 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
164 _("Failed to remove configuration file %s\n"), config_file); 164 _("Failed to remove configuration file %s\n"),
165 config_file);
165 } 166 }
166 if (GNUNET_DISK_directory_remove (dir) != GNUNET_OK) 167 if (GNUNET_OK != GNUNET_DISK_directory_remove (dir))
167 { 168 {
168 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 169 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
169 _("Failed to remove servicehome directory %s\n"), dir); 170 _("Failed to remove servicehome directory %s\n"),
171 dir);
170 172
171 } 173 }
172} 174}
@@ -192,8 +194,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
192 GNUNET_ARM_monitor_disconnect_and_free (m); 194 GNUNET_ARM_monitor_disconnect_and_free (m);
193 m = NULL; 195 m = NULL;
194 } 196 }
195 if ((end == GNUNET_YES) && (delete == GNUNET_YES)) 197 if ((GNUNET_YES == end) && (GNUNET_YES == delete))
196 delete_files (); 198 delete_files ();
197 GNUNET_CONFIGURATION_destroy (cfg); 199 GNUNET_CONFIGURATION_destroy (cfg);
198 cfg = NULL; 200 cfg = NULL;
199} 201}
@@ -588,7 +590,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
588 if (list) 590 if (list)
589 { 591 {
590 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 592 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
591 "Going to list all running services controlled by ARM.\n"); 593 "Going to list all running services controlled by ARM.\n");
592 GNUNET_ARM_request_service_list (h, 594 GNUNET_ARM_request_service_list (h,
593 (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, 595 (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout,
594 &list_callback, &list); 596 &list_callback, &list);
@@ -673,10 +675,10 @@ run (void *cls,
673 cfg = GNUNET_CONFIGURATION_dup (c); 675 cfg = GNUNET_CONFIGURATION_dup (c);
674 config_file = cfgfile; 676 config_file = cfgfile;
675 if (GNUNET_OK != 677 if (GNUNET_OK !=
676 GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &dir)) 678 GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "GNUNET_HOME", &dir))
677 { 679 {
678 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, 680 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
679 "PATHS", "SERVICEHOME"); 681 "PATHS", "GNUNET_HOME");
680 return; 682 return;
681 } 683 }
682 if (NULL != cfgfile) 684 if (NULL != cfgfile)
diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf
index 157a03027..1f1ac282f 100644
--- a/src/arm/test_arm_api_data.conf
+++ b/src/arm/test_arm_api_data.conf
@@ -16,7 +16,6 @@ PORT = 23355
16AUTOSTART = NO 16AUTOSTART = NO
17PORT = 2223 17PORT = 2223
18HOSTNAME = localhost 18HOSTNAME = localhost
19HOME = $SERVICEHOME
20BINARY = /will/be/overwritten/by/test_exponential_backoff 19BINARY = /will/be/overwritten/by/test_exponential_backoff
21ACCEPT_FROM = 127.0.0.1; 20ACCEPT_FROM = 127.0.0.1;
22ACCEPT_FROM6 = ::1; 21ACCEPT_FROM6 = ::1;