Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2025 08:59:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 285394] sysutils/consolekit2 seems to use wrong tty
Message-ID:  <bug-285394-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D285394

            Bug ID: 285394
           Summary: sysutils/consolekit2 seems to use wrong tty
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: desktop@FreeBSD.org
          Reporter: avg@FreeBSD.org
             Flags: maintainer-feedback?(desktop@FreeBSD.org)
          Assignee: desktop@FreeBSD.org

I use lightdm as a DM and I often have multiple (usually two) X sessions on
different VT-s.
In that setup I often (always?) observe that console-kit loses track of act=
ive
session resulting in things like automatic screen lock not working.

Also, I see messages like these during initial startup and VT switches:
console-kit-daemon[2882]: WARNING: Unable to activate console: Inappropriate
ioctl for device
console-kit-daemon[2882]: WARNING: Error waiting for native console 10
activation: Inappropriate ioctl for device
console-kit-daemon[2882]: WARNING: Error waiting for native console 9
activation: Inappropriate ioctl for device
console-kit-daemon[2882]: WARNING: Error waiting for native console 11
activation: Inappropriate ioctl for device

Using ktrace and fstat I determined that console-kit tries to do ioctl on a
file descriptor that's been revoked (not associated with any file):

  2821 100888 console-kit-daemon CALL  ioctl(0xa,VT_ACTIVATE,0x9)
  2821 100888 console-kit-daemon RET   ioctl -1 errno 25 Inappropriate ioctl
for device

I determined that originally that descriptor is produced by opening /dev/tt=
y.
I haven't been to determined when it gets revoked.

However, I think that this already reveals the problem.
I think that on FreeBSD /dev/tty is a controlling terminal.
I am not sure what the controlling terminal of daemons like lightdm and
console-kit-daemon is supposed to be and how it should behavior during
operations like VT switches.
Maybe there is some underlying problem in FreeBSD terminal code.

However, given the type of operations that console-kit does on that termina=
l, I
think that opening /dev/ttyv0 would be more appropriate and that file
descriptor would be more stable.

In fact, I patched console-kit to do that and since then I do not see any
problems like I saw before.
The descriptor is always good:
root     console-kit-daemon  3974   10 /dev        124 crw-------   ttyv0  r

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-285394-7788>