Make sure a process service starts-on-console matches runs-on-console.
authorDavin McCall <davmac@davmac.org>
Sat, 10 Feb 2018 14:42:03 +0000 (14:42 +0000)
committerDavin McCall <davmac@davmac.org>
Sat, 10 Feb 2018 14:42:03 +0000 (14:42 +0000)
TODO
src/load-service.cc

diff --git a/TODO b/TODO
index 8356d7e71fcd000a47b32b5286c4f235943f77db..72220a4b6d00640ca0193c31d423851fa00442bf 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,3 @@
-* Prevent PROCESS services from being starts-on-console without also being runs-on-console.
-
 * shutdown command presently hangs if terminal output blocked (scroll lock
   via ^S). Should use a buffer as dinit does, and pipe output from subcommands
   via the buffer too - if the buffer becomes full, discard subcommand output
@@ -15,7 +13,6 @@ For version 1.0:
 ----------------
 * Man pages for all programs (done for dinit, not for dinitctl/shutdown/etc).
 * Write wtmp entry on startup (see simpleinit)
-* Allow running services as a different UID
 * "triggered" service type: external process notifies Dinit when the service
   has started.
 * Ability to reload stopped services (reload service description)
index ba2bfe409f68cf566037175ace1cfc19f1bf6193..b6d72f5859a80ef61b45ad063f3100f93cd6567b 100644 (file)
@@ -622,6 +622,8 @@ service_record * dirload_service_set::load_service(const char * name)
                     rvalps->set_start_interruptible(start_is_interruptible);
                     rvalps->set_extra_termination_signal(term_signal);
                     rvalps->set_run_as_uid_gid(run_as_uid, run_as_gid);
+                    // process service start / run on console must be the same:
+                    onstart_flags.starts_on_console = onstart_flags.runs_on_console;
                     rval = rvalps;
                 }
                 else if (service_type == service_type_t::BGPROCESS) {
@@ -635,6 +637,7 @@ service_record * dirload_service_set::load_service(const char * name)
                     rvalps->set_start_interruptible(start_is_interruptible);
                     rvalps->set_extra_termination_signal(term_signal);
                     rvalps->set_run_as_uid_gid(run_as_uid, run_as_gid);
+                    onstart_flags.runs_on_console = false;
                     rval = rvalps;
                 }
                 else if (service_type == service_type_t::SCRIPTED) {