Page MenuHomeFreeBSD

syslogd: Keep console and tty descriptors open
ClosedPublic

Authored by jfree on Oct 15 2023, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 12:57 PM
Unknown Object (File)
Apr 7 2024, 7:09 PM
Unknown Object (File)
Apr 7 2024, 11:08 AM
Unknown Object (File)
Apr 7 2024, 10:28 AM
Unknown Object (File)
Mar 13 2024, 4:41 AM
Unknown Object (File)
Feb 12 2024, 11:03 PM
Unknown Object (File)
Jan 8 2024, 2:15 AM
Unknown Object (File)
Dec 25 2023, 5:22 PM
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.