Page MenuHomeFreeBSD

syslogd: Keep console and tty descriptors open
ClosedPublic

Authored by jfree on Oct 15 2023, 9:49 PM.
Tags
None
Referenced Files
F131657420: D42215.id128827.diff
Fri, Oct 10, 2:46 AM
F131648501: D42215.diff
Fri, Oct 10, 12:59 AM
Unknown Object (File)
Tue, Sep 23, 5:03 AM
Unknown Object (File)
Tue, Sep 16, 3:16 AM
Unknown Object (File)
Fri, Sep 12, 5:58 PM
Unknown Object (File)
Sep 7 2025, 1:00 PM
Unknown Object (File)
Sep 7 2025, 4:49 AM
Unknown Object (File)
Aug 16 2025, 4:32 AM
Subscribers

Details

Summary
Console and tty descriptors are initially opened in parse_action() to
determine whether they are valid using isatty(). That descriptor is then
closed because it is never accessed by syslogd again; ttymsg() will reopen
the tty/console under a new descriptor when needed.

If the user attempts to log to a tty that is inactive outside of
syslogd, then syslogd must keep that descriptor open so the tty remains
accessible. For example, logging to `/dev/ttyvb` requires the initial
`/dev/ttyvb` descriptor to stay open so the user can view its buffer at
any time via CTRL+ALT+F12.

As a result, console and tty descriptors must remain open until a
potential configuration reload or a system shutdown. The given
descriptor will be closed in close_filed() in such circumstances.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jfree requested review of this revision.Oct 15 2023, 9:49 PM

Please be sure to include Fixes:/Reported by:/PR: in the commit message.

This revision is now accepted and ready to land.Oct 15 2023, 9:58 PM
This revision was automatically updated to reflect the committed changes.