summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-09-24 18:21:53 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-09-24 18:21:53 +0200
commitd07beeb5398659712e370a977ade6d9a27b84522 (patch)
treebfaee9ee71e9e0ad3e99069eacb04535898b8258 /src
parent6aa35f62a80056f31ccd97133a0764a0950e1566 (diff)
downloadgnunet-d07beeb5398659712e370a977ade6d9a27b84522.tar.gz
gnunet-d07beeb5398659712e370a977ade6d9a27b84522.zip
add stopping state
Diffstat (limited to 'src')
-rw-r--r--src/arm/gnunet-arm.c26
-rw-r--r--src/arm/gnunet-service-arm.c4
-rw-r--r--src/include/gnunet_arm_service.h6
3 files changed, 25 insertions, 11 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index fcbff2331..954d31cfb 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -561,20 +561,24 @@ list_callback(void *cls,
561 fprintf(stdout, "%s (binary='%s', status=stopped)\n", list[i].name, list[i].binary); 561 fprintf(stdout, "%s (binary='%s', status=stopped)\n", list[i].name, list[i].binary);
562 break; 562 break;
563 case GNUNET_ARM_SERVICE_STATUS_FAILED: 563 case GNUNET_ARM_SERVICE_STATUS_FAILED:
564 restart_in = GNUNET_TIME_absolute_get_remaining (list[i].restart_at); 564 restart_in = GNUNET_TIME_absolute_get_remaining (list[i].restart_at);
565 fprintf(stdout, "%s (binary='%s', status=failed, exit_status=%d, restart_delay='%s')\n", 565 fprintf(stdout, "%s (binary='%s', status=failed, exit_status=%d, restart_delay='%s')\n",
566 list[i].name, 566 list[i].name,
567 list[i].binary, 567 list[i].binary,
568 list[i].last_exit_status, 568 list[i].last_exit_status,
569 GNUNET_STRINGS_relative_time_to_string (restart_in, GNUNET_YES)); 569 GNUNET_STRINGS_relative_time_to_string (restart_in, GNUNET_YES));
570 break; 570 break;
571 case GNUNET_ARM_SERVICE_STATUS_FINISHED: 571 case GNUNET_ARM_SERVICE_STATUS_FINISHED:
572 fprintf(stdout, "%s (binary='%s', status=finished)\n", list[i].name, list[i].binary); 572 fprintf(stdout, "%s (binary='%s', status=finished)\n", list[i].name, list[i].binary);
573 break; 573 break;
574 case GNUNET_ARM_SERVICE_STATUS_STARTED: 574 case GNUNET_ARM_SERVICE_STATUS_STARTED:
575 fprintf(stdout, "%s (binary='%s', status=started)\n", list[i].name, list[i].binary); 575 fprintf(stdout, "%s (binary='%s', status=started)\n", list[i].name, list[i].binary);
576 break; 576 break;
577 case GNUNET_ARM_SERVICE_STATUS_STOPPING:
578 fprintf(stdout, "%s (binary='%s', status=stopping)\n", list[i].name, list[i].binary);
579 break;
577 default: 580 default:
581 GNUNET_break_op (0);
578 fprintf(stdout, "%s (binary='%s', status=unknown)\n", list[i].name, list[i].binary); 582 fprintf(stdout, "%s (binary='%s', status=unknown)\n", list[i].name, list[i].binary);
579 break; 583 break;
580 584
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index b30ae518e..65404bbed 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -1400,6 +1400,10 @@ handle_list(void *cls, const struct GNUNET_ARM_Message *request)
1400 ssm->last_exit_status = htons (sl->last_exit_status); 1400 ssm->last_exit_status = htons (sl->last_exit_status);
1401 } 1401 }
1402 } 1402 }
1403 else if ((NULL != sl->killing_client) || (GNUNET_YES == in_shutdown))
1404 {
1405 ssm->status = htonl (GNUNET_ARM_SERVICE_STATUS_STOPPING);
1406 }
1403 else 1407 else
1404 { 1408 {
1405 ssm->status = htonl (GNUNET_ARM_SERVICE_STATUS_STARTED); 1409 ssm->status = htonl (GNUNET_ARM_SERVICE_STATUS_STARTED);
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h
index 9e79c26e7..32355a3e5 100644
--- a/src/include/gnunet_arm_service.h
+++ b/src/include/gnunet_arm_service.h
@@ -174,6 +174,12 @@ enum GNUNET_ARM_ServiceStatus
174 * The service was started, but then exited normally. 174 * The service was started, but then exited normally.
175 */ 175 */
176 GNUNET_ARM_SERVICE_STATUS_FINISHED = 3, 176 GNUNET_ARM_SERVICE_STATUS_FINISHED = 3,
177
178 /**
179 * The service was started, and we're currently waiting
180 * for it to be stopped.
181 */
182 GNUNET_ARM_SERVICE_STATUS_STOPPING = 4,
177}; 183};
178 184
179 185