chiark / gitweb /
Remove support for auto-spawning VTs
authorSven Eden <yamakuzure@gmx.net>
Thu, 26 Jan 2017 09:15:42 +0000 (10:15 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:23:10 +0000 (10:23 +0100)
Auto-spawning VTs requires systemd in practice.  If you're using systemd
you can just use its logind :)

man/logind.conf.xml
src/login/elogind.conf
src/login/logind-core.c
src/login/logind-dbus.c
src/login/logind-gperf.gperf
src/login/logind-seat.c
src/login/logind-seat.h
src/login/logind.c
src/login/logind.h

index 1f7cfc9964b30e92b63b6de39954560bb5e28d15..9d1f13a5ea0eb2e7f32b0c1fe877ba2cc731307d 100644 (file)
 
     <variablelist>
 
-      <varlistentry>
-        <term><varname>NAutoVTs=</varname></term>
-
-        <listitem><para>Takes a positive integer. Configures how many
-        virtual terminals (VTs) to allocate by default that, when
-        switched to and are previously unused,
-        <literal>autovt</literal> services are automatically spawned
-        on. These services are instantiated from the template unit
-        <filename>autovt@.service</filename> for the respective VT TTY
-        name, for example, <filename>autovt@tty4.service</filename>.
-        By default, <filename>autovt@.service</filename> is linked to
-        <filename>getty@.service</filename>. In other words, login
-        prompts are started dynamically as the user switches to unused
-        virtual terminals. Hence, this parameter controls how many
-        login <literal>gettys</literal> are available on the VTs. If a
-        VT is already used by some other subsystem (for example, a
-        graphical login), this kind of activation will not be
-        attempted. Note that the VT configured in
-        <varname>ReserveVT=</varname> is always subject to this kind
-        of activation, even if it is not one of the VTs configured
-        with the <varname>NAutoVTs=</varname> directive. Defaults to
-        6. When set to 0, automatic spawning of
-        <literal>autovt</literal> services is
-        disabled.</para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><varname>ReserveVT=</varname></term>
-
-        <listitem><para>Takes a positive integer. Identifies one
-        virtual terminal that shall unconditionally be reserved for
-        <filename>autovt@.service</filename> activation (see above).
-        The VT selected with this option will be marked busy
-        unconditionally, so that no other subsystem will allocate it.
-        This functionality is useful to ensure that, regardless of how
-        many VTs are allocated by other subsystems, one login
-        <literal>getty</literal> is always available. Defaults to 6
-        (in other words, there will always be a
-        <literal>getty</literal> available on Alt-F6.). When set to 0,
-        VT reservation is disabled.</para></listitem>
-      </varlistentry>
-
       <varlistentry>
         <term><varname>KillUserProcesses=</varname></term>
 
index 25edfce6f6a2f59a859badfd1ff7df3343558a5d..85e297dd38bff9e03e089253117199b63f5864a6 100644 (file)
@@ -12,8 +12,6 @@
 # See elogind.conf(5) for details.
 
 [Login]
-#NAutoVTs=6
-#ReserveVT=6
 #KillUserProcesses=no
 #KillOnlyUsers=
 #KillExcludeUsers=root
index 107b3243a5a1701f1e2ac9ed017eaaf9dd0aa740..dd681401aae2e592aef96640ffab62f0a95bd04e 100644 (file)
@@ -374,6 +374,8 @@ bool manager_shall_kill(Manager *m, const char *user) {
         return strv_contains(m->kill_only_users, user);
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int vt_is_busy(unsigned int vtnr) {
         struct vt_stat vt_stat;
         int r = 0;
@@ -438,6 +440,7 @@ int manager_spawn_autovt(Manager *m, unsigned int vtnr) {
 
         return r;
 }
+#endif // 0
 
 bool manager_is_docked(Manager *m) {
         Iterator i;
index 31580af52541663a24896dce209a070eb258f92e..a0a23788b2fa3740b20e350f167f2e1616ee8955 100644 (file)
@@ -2447,7 +2447,7 @@ const sd_bus_vtable manager_vtable[] = {
         SD_BUS_WRITABLE_PROPERTY("EnableWallMessages", "b", NULL, NULL, offsetof(Manager, enable_wall_messages), 0),
         SD_BUS_WRITABLE_PROPERTY("WallMessage", "s", NULL, NULL, offsetof(Manager, wall_message), 0),
 
-        SD_BUS_PROPERTY("NAutoVTs", "u", NULL, offsetof(Manager, n_autovts), SD_BUS_VTABLE_PROPERTY_CONST),
+//        SD_BUS_PROPERTY("NAutoVTs", "u", NULL, offsetof(Manager, n_autovts), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KillOnlyUsers", "as", NULL, offsetof(Manager, kill_only_users), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KillExcludeUsers", "as", NULL, offsetof(Manager, kill_exclude_users), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KillUserProcesses", "b", NULL, offsetof(Manager, kill_user_processes), SD_BUS_VTABLE_PROPERTY_CONST),
index 9218d098e024aa9f87b5fa1750247fd5ea229209..d9fa06c1f672f6658e9e8addcbecfd98741a7ad1 100644 (file)
@@ -14,8 +14,6 @@ struct ConfigPerfItem;
 %struct-type
 %includes
 %%
-Login.NAutoVTs,                    config_parse_unsigned,      0, offsetof(Manager, n_autovts)
-Login.ReserveVT,                   config_parse_unsigned,      0, offsetof(Manager, reserve_vt)
 Login.KillUserProcesses,           config_parse_bool,          0, offsetof(Manager, kill_user_processes)
 Login.KillOnlyUsers,               config_parse_strv,          0, offsetof(Manager, kill_only_users)
 Login.KillExcludeUsers,            config_parse_strv,          0, offsetof(Manager, kill_exclude_users)
index 8d13a63688180d7b029cab930e272259a4e9e64d..1be8713754c3fec5503c8c8e06a6b8a9273fc3c4 100644 (file)
@@ -169,6 +169,8 @@ int seat_load(Seat *s) {
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int vt_allocate(unsigned int vtnr) {
         char p[sizeof("/dev/tty") + DECIMAL_STR_MAX(unsigned int)];
         _cleanup_close_ int fd = -1;
@@ -210,6 +212,7 @@ int seat_preallocate_vts(Seat *s) {
 
         return r;
 }
+#endif // 0
 
 int seat_apply_acls(Seat *s, Session *old_active) {
         int r;
@@ -361,7 +364,11 @@ int seat_active_vt_changed(Seat *s, unsigned int vtnr) {
         }
 
         r = seat_set_active(s, new_active);
+
+/// elogind does not spawn autovt
+#if 0
         manager_spawn_autovt(s->manager, vtnr);
+#endif // 0
 
         return r;
 }
@@ -420,7 +427,10 @@ int seat_start(Seat *s) {
                    NULL);
 
         /* Initialize VT magic stuff */
+/// elogind does not support autospawning vts
+#if 0
         seat_preallocate_vts(s);
+#endif // 0
 
         /* Read current VT */
         seat_read_active_vt(s);
index 248dbeb9d7d94957b4e32907bf8a13ded68d71cc..fe13aabfc5ab965b4cf737e12f280c95be7cb0c1 100644 (file)
@@ -60,7 +60,7 @@ int seat_switch_to_next(Seat *s);
 int seat_switch_to_previous(Seat *s);
 int seat_active_vt_changed(Seat *s, unsigned int vtnr);
 int seat_read_active_vt(Seat *s);
-int seat_preallocate_vts(Seat *s);
+// UNNEEDED int seat_preallocate_vts(Seat *s);
 
 int seat_attach_session(Seat *s, Session *session);
 void seat_complete_switch(Seat *s);
index 586d92fcaf0b1f630fcb16a4a0f2bdfd34ca9433..a51f02ebe95c89d688d2eac724347f07f4480529 100644 (file)
@@ -50,10 +50,14 @@ static Manager *manager_new(void) {
         m->pin_cgroupfs_fd = -1;
 
         m->console_active_fd = -1;
+
+/// elogind does not support autospawning of vts
+#if 0
         m->reserve_vt_fd = -1;
 
         m->n_autovts = 6;
         m->reserve_vt = 6;
+#endif // 0
         m->remove_ipc = true;
         m->inhibit_delay_max = 5 * USEC_PER_SEC;
         m->handle_power_key = HANDLE_POWEROFF;
@@ -180,7 +184,10 @@ static void manager_free(Manager *m) {
         sd_bus_unref(m->bus);
         sd_event_unref(m->event);
 
+/// elogind does not support autospawning of vts
+#if 0
         safe_close(m->reserve_vt_fd);
+#endif // 0
 
         manager_shutdown_cgroup(m, true);
 
@@ -521,6 +528,8 @@ static int manager_dispatch_device_udev(sd_event_source *s, int fd, uint32_t rev
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int manager_dispatch_vcsa_udev(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
         _cleanup_udev_device_unref_ struct udev_device *d = NULL;
         Manager *m = userdata;
@@ -542,6 +551,7 @@ static int manager_dispatch_vcsa_udev(sd_event_source *s, int fd, uint32_t reven
 
         return 0;
 }
+#endif // 0
 
 static int manager_dispatch_button_udev(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
         _cleanup_udev_device_unref_ struct udev_device *d = NULL;
@@ -568,6 +578,8 @@ static int manager_dispatch_console(sd_event_source *s, int fd, uint32_t revents
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int manager_reserve_vt(Manager *m) {
         _cleanup_free_ char *p = NULL;
 
@@ -590,6 +602,7 @@ static int manager_reserve_vt(Manager *m) {
 
         return 0;
 }
+#endif // 0
 
 static int manager_connect_bus(Manager *m) {
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
@@ -871,6 +884,8 @@ static int manager_connect_udev(Manager *m) {
         }
 
         /* Don't bother watching VCSA devices, if nobody cares */
+/// elogind does not support autospawning of vts
+#if 0
         if (m->n_autovts > 0 && m->console_active_fd >= 0) {
 
                 m->udev_vcsa_monitor = udev_monitor_new_from_netlink(m->udev, "udev");
@@ -889,6 +904,7 @@ static int manager_connect_udev(Manager *m) {
                 if (r < 0)
                         return r;
         }
+#endif // 0
 
         return 0;
 }
@@ -1068,7 +1084,10 @@ static int manager_startup(Manager *m) {
         manager_gc(m, false);
 
         /* Reserve the special reserved VT */
+/// elogind does not support autospawning of vts
+#if 0
         manager_reserve_vt(m);
+#endif // 0
 
         /* And start everything */
         HASHMAP_FOREACH(seat, m->seats, i)
index a74a3e4835acfc9f27c7d08afc426e8660b01d0a..654744bb4585a5240ea06135d0bed4fc47540077 100644 (file)
@@ -78,10 +78,13 @@ struct Manager {
 
         int console_active_fd;
 
+/// elogind does not support autospawning of vts
+#if 0
         unsigned n_autovts;
 
         unsigned reserve_vt;
         int reserve_vt_fd;
+#endif // 0
 
         Seat *seat0;
 
@@ -160,7 +163,7 @@ int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibitor);
 int manager_process_seat_device(Manager *m, struct udev_device *d);
 int manager_process_button_device(Manager *m, struct udev_device *d);
 
-int manager_spawn_autovt(Manager *m, unsigned int vtnr);
+// UNNEEDED int manager_spawn_autovt(Manager *m, unsigned int vtnr);
 
 bool manager_shall_kill(Manager *m, const char *user);