[ConsoleKit] Active VT tracking can fail at startup

Leen Besselink consolekit at consolejunkie.net
Wed Aug 25 00:58:41 PDT 2010


On 08/25/2010 01:32 AM, Lennart Poettering wrote:
> On Wed, 25.08.10 01:27, Leen Besselink (consolekit at consolejunkie.net) wrote:
>
>   
>>> /dev/tty is the tty of the controlling terminal of the currently
>>> running process.  consolekit is daemon, so it shouldn't have a
>>> controlling terminal.  It could be that ck is getting started with
>>>   
>>>       
>> Yes, in Ubuntu, it is started with --no-daemon.
>>
>> And possible others, because it seems to be the current default for dbus
>> in git:
>>
>>
>> http://cgit.freedesktop.org/ConsoleKit/tree/data/org.freedesktop.ConsoleKit.service.in
>>     
> Note that dbus calls setsid() when forking off processes. That should
> ensure that CK has no controlling terminal. However, because Unix is
> stupid CK would reacquire one as soon as it opens the first tty without
> O_NOCTTY. I wonder if that might have been forgotten somwhere?
>
> Lennart
>
>   
Now it's time for some fun.

This morning I did some more testing, when it fails, it did not find any
console_fd, it just returns 3.

Because that is the last value of fd from the loop at the end of
ck_get_a_console_fd




More information about the ConsoleKit mailing list