mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
Prune bootstrap tasks/services that never ran
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f91205cbad
commit
e88241316b
3 files changed
+21
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user