Refactor tty handling to use service backend enabling conditions etc.

Initial refactor of the tty implementation to use the service/run/task
general backend.  This enables all the features of services also for
ttys, except logging because it makes no sense.

Work in progress:

 - plugins/tty.c does not work anymore, could possibly be removed in
   favor of usinga (a new) condition instead (if-tty-exists)
 - fallback tty does not work anymore, should we remove it, or can we
   handle it as an optional built-in with (a new) condition?
 - @console does not work anymore, needs to generate N cloned services

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-04-14 16:29:19 +02:00
1 parent 3cf5d36972
commit 30020263ba
12 files changed
+285 -497

No files matched your search

+6 -10
View File
@@ -206,10 +206,6 @@ restart:
break;
}
/* No TTYs run at bootstrap, they have a delayed start. */
if (prevlevel > 0)
tty_runlevel();
sm->state = SM_RUNNING_STATE;
break;
@@ -224,8 +220,7 @@ restart:
_d("Stopping services not allowed after reconf ...");
sm->in_teardown = 1;
cond_reload();
service_step_all(SVC_TYPE_SERVICE);
tty_reload(NULL);
service_step_all(SVC_TYPE_ANY);
sm->state = SM_RELOAD_WAIT_STATE;
break;
@@ -242,16 +237,17 @@ restart:
}
sm->in_teardown = 0;
/* Cleanup stale services */
svc_clean_dynamic(service_unregister);
_d("Starting services after reconf ...");
service_step_all(SVC_TYPE_SERVICE);
service_step_all(SVC_TYPE_ANY);
/* Cleanup stale services */
svc_clean_dynamic(service_unregister);
_d("Calling reconf hooks ...");
plugin_run_hooks(HOOK_SVC_RECONF);
service_step_all(SVC_TYPE_SERVICE);
service_step_all(SVC_TYPE_ANY);
_d("Reconfiguration done");
sm->state = SM_RUNNING_STATE;