git: ttys: Add 'ifexists' option to enable ttys only if exists
Aaron LI
aly at crater.dragonflybsd.org
Wed Sep 20 22:25:14 PDT 2023
commit f0e61bb7995c1cccad2d39368522d1e4deeee668
Author: Aaron LI <aly at aaronly.me>
Date: Wed Sep 20 15:13:41 2023 +0800
ttys: Add 'ifexists' option to enable ttys only if exists
Implement the 'ifexists' ttys option in init(8) to enable a tty only if
it exists. This allows one to turn off getty for ttys that aren't
present (e.g., on a headless system), and thus prevent getty error logs
from filling up /var/log/messages; e.g.,
------
Sep 20 09:13:07 microserver getty[236362]: open /dev/ttyv0: No such file or directory
Sep 20 09:13:07 microserver getty[236404]: open /dev/ttyv0: No such file or directory
Sep 20 09:13:07 microserver getty[236405]: open /dev/ttyv0: No such file or directory
Sep 20 09:13:07 microserver getty[236406]: open /dev/ttyv0: No such file or directory
Sep 20 09:13:07 microserver getty[236407]: open /dev/ttyv0: No such file or directory
Sep 20 09:13:07 microserver init: getty repeating too quickly on port /dev/ttyv0, sleeping 30 secs
------
Update the ttys(5) and getttyent(3) man pages accordingly.
The updates to ttys files will follow.
Discussed-with: dillon
Credit: https://reviews.freebsd.org/D10037
Summary of changes:
include/ttyent.h | 2 ++
lib/libc/gen/getttyent.3 | 12 ++++++------
lib/libc/gen/getttyent.c | 2 ++
libexec/getty/ttys.5 | 3 ++-
sbin/init/init.c | 20 +++++++++++++++-----
5 files changed, 27 insertions(+), 12 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f0e61bb7995c1cccad2d39368522d1e4deeee668
--
DragonFly BSD source repository
More information about the Commits
mailing list