aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2020-05-14 15:42:36 +0200
committerDavid Oberhollenzer <goliath@infraroot.at>2020-05-14 16:09:08 +0200
commit16b22a831c490b8dd1b5f81a4955e6f13f22705d (patch)
treeceee9eca7765788cdf77ff9942475852e6be2c40
parent2961e8917f9c39e417e53b5048287f91b611392d (diff)
Cleanup: remove target completion hooks
Simply make the service scripts handle accordingly. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
-rw-r--r--initd/config.c23
-rw-r--r--initd/init.h15
-rw-r--r--initd/main.c25
3 files changed, 0 insertions, 63 deletions
diff --git a/initd/config.c b/initd/config.c
index 7f9f25c..d994faa 100644
--- a/initd/config.c
+++ b/initd/config.c
@@ -15,7 +15,6 @@ static size_t queue_count[TGT_MAX];
/* current state */
static size_t queue_idx = 0;
static int target = TGT_BOOT;
-static size_t singleshot = 0;
int config_load(void)
{
@@ -103,29 +102,7 @@ void config_set_target(int tgt)
queue_idx = 0;
}
-int config_get_current_target(void)
-{
- return target;
-}
-
-bool config_is_current_target_complete(void)
-{
- return singleshot == 0 && queue_idx >= queue_count[target];
-}
-
bool config_should_respawn(void)
{
return target != TGT_REBOOT && target != TGT_SHUTDOWN;
}
-
-void config_singleshot_started(void)
-{
- singleshot++;
-}
-
-void config_singleshot_terminated(void)
-{
- assert(singleshot > 0);
-
- singleshot--;
-}
diff --git a/initd/init.h b/initd/init.h
index 3400ec0..1a9f35a 100644
--- a/initd/init.h
+++ b/initd/init.h
@@ -58,24 +58,9 @@ svc_run_data_t *config_dequeue(void);
*/
void config_set_target(int tgt);
-/* get the current run time target from the configuration manager */
-int config_get_current_target(void);
-
-/*
- Find out if the current target is completed, i.e. there are no more services
- left in the queue and no active single shot services.
- */
-bool config_is_current_target_complete(void);
-
/* Ask whether we should respawn services in the current target */
bool config_should_respawn(void);
-/* notify the configuration manager that a single shot service started */
-void config_singleshot_started(void);
-
-/* notify the configuration manager that a single shot service terminated */
-void config_singleshot_terminated(void);
-
/********** print_status.c **********/
void print_status(const svc_run_data_t *rt);
diff --git a/initd/main.c b/initd/main.c
index dbd4abf..6d46408 100644
--- a/initd/main.c
+++ b/initd/main.c
@@ -60,9 +60,6 @@ static void handle_exited(svc_run_data_t *rt)
}
print_status(rt);
-
- if (rt->svc->type == SVC_ONCE)
- config_singleshot_terminated();
}
}
@@ -95,9 +92,6 @@ static void start_service(svc_run_data_t *rt)
handle_exited(terminated);
} while (terminated != rt);
break;
- case SVC_ONCE:
- config_singleshot_started();
- break;
}
}
@@ -117,22 +111,6 @@ static void handle_signal(int signo)
}
}
-static void handle_target_completed(void)
-{
- switch (config_get_current_target()) {
- case TGT_BOOT:
- break;
- case TGT_SHUTDOWN:
- for (;;)
- reboot(RB_POWER_OFF);
- break;
- case TGT_REBOOT:
- for (;;)
- reboot(RB_AUTOBOOT);
- break;
- }
-}
-
int main(void)
{
svc_run_data_t *rt;
@@ -164,9 +142,6 @@ int main(void)
} else {
start_service(rt);
}
-
- if (config_is_current_target_complete())
- handle_target_completed();
}
return EXIT_SUCCESS;