Prune bootstrap tasks/services that never ran

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-10-16 09:42:08 +02:00
1 parent f91205cbad
commit e88241316b
3 files changed
+21

No files matched your search

+3
View File
@@ -440,6 +440,9 @@ int main(int argc, char* argv[])
*/
service_runlevel(cfglevel);
/* Clean up bootstrap-only tasks/services that never started */
svc_prune_bootstrap();
_d("Running svc up hooks ...");
plugin_run_hooks(HOOK_SVC_UP);
+17
View File
@@ -486,6 +486,23 @@ int svc_clean_bootstrap(svc_t *svc)
return 0;
}
/**
* svc_prune_bootstrap - Prune any remaining bootstrap tasks
*
* This function cleans up all bootstrap tasks that have not yet been
* collected, or that never even ran in bootstrap. All other instances
* when svc_clean_bootstrap() is called are when a service is collected.
*/
void svc_prune_bootstrap(void)
{
svc_t *svc;
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
if (!svc->pid)
svc_clean_bootstrap(svc);
}
}
char *svc_status(svc_t *svc)
{
switch (svc->state) {
+1
View File
@@ -166,6 +166,7 @@ void svc_mark_dirty (svc_t *svc);
void svc_mark_clean (svc_t *svc);
void svc_clean_dynamic (void (*cb)(svc_t *));
int svc_clean_bootstrap (svc_t *svc);
void svc_prune_bootstrap (void);
char *svc_status (svc_t *svc);
const char *svc_dirtystr (svc_t *svc);