[kmscon-devel] [PATCH] systemd: take over for autovt@ when enabled

David Herrmann dh.herrmann at gmail.com
Mon Jul 22 05:35:31 PDT 2013


Hi

On Mon, Jul 22, 2013 at 2:21 PM, Tom Gundersen <teg at jklm.no> wrote:
> ---
>  docs/kmsconvt at .service | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/docs/kmsconvt at .service b/docs/kmsconvt at .service
> index 7b64823..f1084b4 100644
> --- a/docs/kmsconvt at .service
> +++ b/docs/kmsconvt at .service
> @@ -4,10 +4,7 @@
>  # spawns KMSCON on this VT. Note that this does automatically limit KMSCON to
>  # seat0. You cannot spawn KMSCON on other seats with this unit.
>  #
> -# You can replace the default getty at .service that is shipped with systemd by
> -# linking it with:
> -#   ln -s /usr/lib/systemd/system/kmsconvt at .service /etc/systemd/system/autovt at .service
> -# This will make systemd start KMSCON instead of agetty on each VT. Or more
> +# When enabled, systemd will start KMSCON instead of agetty on each VT. Or more
>  # precisely, this will make systemd-logind use kmsconvt at .service instead of
>  # getty at .service for new VTs. In fact, all other units/scripts/... that use
>  # getty at .service will not be affected by this change.
> @@ -45,4 +42,5 @@ TTYVHangup=yes
>  TTYVTDisallocate=yes
>
>  [Install]
> +Alias=autovt at .service

That was already reported on github. The thing is, "systemctl disable"
doesn't honor "Alias" lines. So if I add this alias and a user does
"systemctl enable kmscon at tty1.service", a following "systemctl disable
kmscon@<whatever>" doesn't remove this alias again.

This gets worse if a user enables "kmscon at .service" as kmscon will
then run on all VTs unless a user removes the symlink manually.

To fix this, we need to adjust systemd: src/shared/install.c:
See unit_file_enable() and unit_file_disable(). *_enable() calls
install_context_apply() -> install_info_apply(), which add all
symlinks for aliases, wants, requires, ... However, *_disable() calls
install_context_mark_for_removal() which only removes the main
unit-file symlink.
While I am not sure about why *_disable() doesn't remove these, I
think we can at least remove "Alias" lines during *_disable().

Anyhow, I want to get this resolved in systemd before applying this
patch. Gettys are a crucial part and kmscon didn't get widespread
testing, yet. If howtos tell users to use "ln -s ...kmsconvt...
...autovt...", it should be obvious for the user to run "rm
...autovt..." to revert it. But if a howto tells them to run
"systemctl enable", it isn't really obvious that a "rm ...autovt..."
is needed. And users tend to run whatever a howto tells them to.. I'd
like to avoid getting angry bugreports for that.

Btw., I intend to work on that in Brno.

Cheers
David

>  WantedBy=getty.target
> --
> 1.8.3.3
>
> _______________________________________________
> kmscon-devel mailing list
> kmscon-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/kmscon-devel


More information about the kmscon-devel mailing list