]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "pid1: order units using TTYVHangup= after vconsole setup"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 Jul 2023 12:32:54 +0000 (14:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 Jul 2023 13:54:33 +0000 (15:54 +0200)
This reverts commit e019ea738d63d5f7803f378f8bd3e074d66be08f.

In the new approach, a lock on /dev/console will be used. This lock will solve
the issue for services which run in early boot. Services which run later are
ordered after sysinit.target, so they'll run much later anyway so this
automatic dependency is not useful. Let's remove it again to make the code
simpler.

man/systemd.exec.xml
src/basic/special.h
src/core/execute.c
src/core/execute.h
src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c

index e077407367777e1f4d3b86208b23af81cbb6c197..c3df4166d5511d6bc160169d13940a3730b4de7e 100644 (file)
 
       <listitem><para>Units whose standard output or error output is connected to <option>journal</option> or
       <option>kmsg</option> (or their combinations with console output, see below) automatically acquire
-      dependencies of type <varname>After=</varname> on <filename>systemd-journald.socket</filename>.
-      </para></listitem>
-
-      <listitem><para>Units using the terminal (standard input, output, or error are connected to a terminal
-      or <varname>TTYPath=</varname> is used) automatically acquire an <varname>After=</varname> dependency
-      on <filename>systemd-vconsole-setup.service</filename>.</para></listitem>
+      dependencies of type <varname>After=</varname> on
+      <filename>systemd-journald.socket</filename>.</para></listitem>
 
       <listitem><para>Units using <varname>LogNamespace=</varname> will automatically gain ordering and
       requirement dependencies on the two socket units associated with
index bc9c9eb011c8a6a68eeec1ae07e97d1dd342614d..b7760079a270131ff47f30831fce3ecd4ed72c0c 100644 (file)
@@ -86,7 +86,6 @@
 #define SPECIAL_QUOTACHECK_SERVICE "systemd-quotacheck.service"
 #define SPECIAL_QUOTAON_SERVICE "quotaon.service"
 #define SPECIAL_REMOUNT_FS_SERVICE "systemd-remount-fs.service"
-#define SPECIAL_VCONSOLE_SETUP_SERVICE "systemd-vconsole-setup.service"
 #define SPECIAL_VOLATILE_ROOT_SERVICE "systemd-volatile-root.service"
 #define SPECIAL_UDEVD_SERVICE "systemd-udevd.service"
 #define SPECIAL_GROWFS_SERVICE "systemd-growfs@.service"
index 445983bfb62325cce465fb8b158033ab035dc519..3a0d289fa551c58c4eb7b9fcc7b53a46be7a03eb 100644 (file)
@@ -7219,16 +7219,6 @@ bool exec_context_has_encrypted_credentials(ExecContext *c) {
         return false;
 }
 
-int exec_context_add_default_dependencies(Unit *u, const ExecContext *c) {
-        assert(u);
-        assert(u->default_dependencies);
-
-        if (c && exec_context_needs_term(c))
-                return unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_VCONSOLE_SETUP_SERVICE,
-                                                   /* add_reference= */ true, UNIT_DEPENDENCY_DEFAULT);
-        return 0;
-}
-
 void exec_status_start(ExecStatus *s, pid_t pid) {
         assert(s);
 
index 09f007bb4e9700fa2964c2e1cc83e213a47c81a8..f784c1a5652c1196d8059cb3a94891cf6ab678ec 100644 (file)
@@ -501,7 +501,6 @@ void exec_context_revert_tty(ExecContext *c);
 
 int exec_context_get_clean_directories(ExecContext *c, char **prefix, ExecCleanMask mask, char ***ret);
 int exec_context_get_clean_mask(ExecContext *c, ExecCleanMask *ret);
-int exec_context_add_default_dependencies(Unit *u, const ExecContext *c);
 
 void exec_status_start(ExecStatus *s, pid_t pid);
 void exec_status_exit(ExecStatus *s, const ExecContext *context, pid_t pid, int code, int status);
index 765c9899ef6cd90512628b4714b1731348e6e56d..7bab18b491905916e6958b8190fccddc8c650ea6 100644 (file)
@@ -608,7 +608,7 @@ static int mount_add_default_dependencies(Mount *m) {
         if (r < 0)
                 return r;
 
-        return exec_context_add_default_dependencies(UNIT(m), &m->exec_context);
+        return 0;
 }
 
 static int mount_verify(Mount *m) {
index c6178cf2cd71a7882e3180695a005c4d16a09d17..0574a909e162769ed74af6528144bb0562d481a1 100644 (file)
@@ -747,12 +747,7 @@ static int service_add_default_dependencies(Service *s) {
                 return r;
 
         /* Third, add us in for normal shutdown. */
-        r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
-        if (r < 0)
-                return r;
-
-        /* Fourth, add generic dependencies */
-        return exec_context_add_default_dependencies(UNIT(s), &s->exec_context);
+        return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
 }
 
 static void service_fix_stdio(Service *s) {
index e4c1f5a793f903ef80987ca0f8c2da85a1ea601d..d72194f20b546f2f3fce38b65cf8eb4ecdf8f666 100644 (file)
@@ -283,11 +283,7 @@ static int socket_add_default_dependencies(Socket *s) {
                         return r;
         }
 
-        r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
-        if (r < 0)
-                return r;
-
-        return exec_context_add_default_dependencies(UNIT(s), &s->exec_context);
+        return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
 }
 
 _pure_ static bool socket_has_exec(Socket *s) {
index 73cf320bfd22062ad9e37e93e9075ea02c4c95c7..fff75ff804091d1e2e6b84f749123db9c7af2e88 100644 (file)
@@ -270,11 +270,7 @@ static int swap_add_default_dependencies(Swap *s) {
         if (r < 0)
                 return r;
 
-        r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
-        if (r < 0)
-                return r;
-
-        return exec_context_add_default_dependencies(UNIT(s), &s->exec_context);
+        return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
 }
 
 static int swap_verify(Swap *s) {