mirror of
https://github.com/troglobit/finit.git
synced 2026-11-24 20:21:44 +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);
|
service_runlevel(cfglevel);
|
||||||
|
|
||||||
|
/* Clean up bootstrap-only tasks/services that never started */
|
||||||
|
svc_prune_bootstrap();
|
||||||
|
|
||||||
_d("Running svc up hooks ...");
|
_d("Running svc up hooks ...");
|
||||||
plugin_run_hooks(HOOK_SVC_UP);
|
plugin_run_hooks(HOOK_SVC_UP);
|
||||||
|
|
||||||
|
|||||||
@@ -486,6 +486,23 @@ int svc_clean_bootstrap(svc_t *svc)
|
|||||||
return 0;
|
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)
|
char *svc_status(svc_t *svc)
|
||||||
{
|
{
|
||||||
switch (svc->state) {
|
switch (svc->state) {
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ void svc_mark_dirty (svc_t *svc);
|
|||||||
void svc_mark_clean (svc_t *svc);
|
void svc_mark_clean (svc_t *svc);
|
||||||
void svc_clean_dynamic (void (*cb)(svc_t *));
|
void svc_clean_dynamic (void (*cb)(svc_t *));
|
||||||
int svc_clean_bootstrap (svc_t *svc);
|
int svc_clean_bootstrap (svc_t *svc);
|
||||||
|
void svc_prune_bootstrap (void);
|
||||||
|
|
||||||
char *svc_status (svc_t *svc);
|
char *svc_status (svc_t *svc);
|
||||||
const char *svc_dirtystr (svc_t *svc);
|
const char *svc_dirtystr (svc_t *svc);
|
||||||
|
|||||||
Reference in new issue
Block a user