dvdhrm / kmscon

Linux KMS/DRM based virtual Console Emulator
http://www.freedesktop.org/wiki/Software/kmscon
Other
432 stars 79 forks source link

Even when kmscon.service is disabled, I see "[ OK ] Started KMS System Console on tty1." during boot. #96

Closed trusktr closed 11 years ago

trusktr commented 11 years ago

I've double checked that no systemd kmscon units are enabled (kmscon.service is the only one that can be enabled AFAIK), but every time I boot up this is what happens:

I see the normal [ OK ] messages from systemd, then during the boot process the screen clears (I'm guessing due to kmscon) and the first output that I see at the top of the screen is [ OK ] Started KMS System Console on tty1., then a few more unrelated [ OK ] messages appear, then finally Gnome Display Manager appears in tty1. After GDM is loaded, ps -aux | grep kmscon shows no trace of kmscon.

Why is kmscon being started (if so) in tty1 during boot even though kmscon.service is disabled?

Note: When kmscon.service is enabled, I still see the same [ OK ] Started KMS System Console on tty1. message. The only difference in behavior is that kmscon is running in tty2 after boot (GDM still on tty1).

trusktr commented 11 years ago

Don't know if this is related, but I noticed that systemctl status kmsconvt@ttyX.service (X being any number) shows the service as enabled, and it is impossible to disable it. Is that expected?

dvdhrm commented 11 years ago

Yes, that is related! kmsconvt@.service is a service file to start kmscon on a given VT. So please stop and disable kmsconvt@tty1.service if you don't want kmscon on tty1. Please also try disabling kmsconvt@.service directly. If you cannot disable a service, then find out why. See which services pulled in the service in question and if nothing helps ask the systemd people for help (or simply revert the steps you took to enable it). This is not related to kmscon.

As I asked in the other thread: Did you follow the instructions on https://wiki.archlinux.org/index.php/KMSCON ? What exactly did you enable? And why did you enable it if you don't want it to? Please provide as many information as possible so we can help you to revert it.

Cheers David

trusktr commented 11 years ago

I see. Thanks. Apparently (and I must've forgotten) I have enabled kmsconvt@tty1.service, and was under the impression that disabling just kmsconvt@.service would disable all of them. I see how it works now.

It seems like enabling kmscon.service is shorthand for enabling kmsconvt@ttyX.service where X is simply the first available tty.

trusktr commented 11 years ago

Oddly I don't see any command in my history to enable kmscon for tty1.

dvdhrm commented 11 years ago

kmscon.service is provided for backwards-compatibility. It automatically picks the first available VT during runtime.

Regarding bash-history: No idea how it works, but it is unreliable if multiple sessions are open at once so use "systemctl --all" instead.

Cheers David

trusktr commented 11 years ago

I have bash set up so that running the comand href (short for history refresh) gathers and cleans the combined history of all terminals from the history file and reloads the history in the current terminal with that combined history (with no duplicates). It's pretty neat!

Anyways, I think I know why I don't see it in my history. I noticed that running the command systemctl enable kmsconvt@.service creates /etc/systemd/system/getty.target.wants/kmsconvt@tty1.service (I'm guessing due to the Alias line in the service file), then to disable and remove that symlink I have to run systemctl disable kmsconvt@tty1.service. For example:

┌─[03:50:26/starlancer/root/~]
└─╼ systemctl enable kmsconvt@.service 
ln -s '/usr/lib/systemd/system/kmsconvt@.service' '/etc/systemd/system/getty.target.wants/kmsconvt@tty1.service'

┌─[03:52:16/starlancer/root/~]
└─╼ systemctl disable kmsconvt@tty1.service 
rm '/etc/systemd/system/getty.target.wants/kmsconvt@tty1.service'

I also noticed that creating that autovt symlink allows me to run systemctl disable kmsconvt@.service to remove it. For example:

┌─[03:52:19/starlancer/root/~]
└─╼ ln -s /usr/lib/systemd/system/kmsconvt@.service /etc/systemd/system/autovt@.service

┌─[03:56:08/starlancer/root/~]
└─╼ systemctl disable kmsconvt@.service 
rm '/etc/systemd/system/autovt@.service'

So enabling kmsconvt@.service creates a file while disabling kmsconvt@.service deletes a completely different file (if that file exists, and by default my system doesn't have it).

I did notice that I have a similar file /usr/lib/systemd/system/autovt@.service symlinked to getty@.service but running systemctl enable autovt@.service results in the following.

┌─[03:58:34/starlancer/root/~]
└─╼ systemctl enable autovt@.service 
Failed to issue method call: No such file or directory

I don't think that matters though. I can also infer that the files in /etc/ take precedence over the ones in /usr/lib/.

It'd be great for there to be some way to enable kmscon by default for tty 1 through 6 (like what systemd somehow does with agetty) with a single systemctl command (no manual symlink creation).

dvdhrm commented 11 years ago

That's not how it works. The systemd people are really reluctant to creating more "systemctl" commands. Instead, users are supposed to use "ln" and create symlinks themselves. That's just how it works. Hence, I will not provide any other integration as long as the systemd say symlink creation is the preferred way of configuration.

Cheers