Page MenuHomeFreeBSD

Impelemnt ttys onifexists in init.
ClosedPublic

Authored by imp on Mar 16 2017, 8:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 10:59 AM
Unknown Object (File)
Mar 9 2024, 10:54 AM
Unknown Object (File)
Mar 9 2024, 10:54 AM
Unknown Object (File)
Mar 9 2024, 10:54 AM
Unknown Object (File)
Mar 7 2024, 10:11 PM
Unknown Object (File)
Dec 23 2023, 11:39 AM
Unknown Object (File)
Nov 11 2023, 9:13 PM
Unknown Object (File)
Nov 3 2023, 5:45 PM
Subscribers

Details

Summary

Implement a new init(8) option in /etc/ttys. If this option is present
on the entry in /etc/ttys, the entry will be active and only if it
exists. If the name starts with a '/', it will be considered an
absolute path. If not, it will be a path relative to /dev.

This allows one to turn off video console getty that aren't present
(while running a getty on them even when they aren't the system
console). Likewise with serial ports.

It differs from onifconsole in only requiring the device exist rather
than it be listed as one of the system consoles.

Sponsored by: Netflix

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

will added a subscriber: will.

LGTM

This revision is now accepted and ready to land.Mar 16 2017, 8:25 PM
vangyzen added a subscriber: vangyzen.
vangyzen added inline comments.
lib/libc/gen/getttyent.c
112 ↗(On Diff #26334)

Testing for dev == NULL might be worthwhile.

access(dev, F_OK) might be cheaper than stat().

lib/libc/gen/getttyent.c
112 ↗(On Diff #26334)

It might be, but there's rough edges around access that stat gets around.

lib/libc/gen/getttyent.c
112 ↗(On Diff #26334)

I'm curious about those rough edges, but that sounds fine.

lib/libc/gen/getttyent.c
112 ↗(On Diff #26334)

access and root haven't mixed well historically. Mostly that's around X_OK checks not actually allowing one to execute the file. So I'm a bit paranoid about using it... stat I know either succeeded or failed and there's little interpretation there.... Maybe not relevant in this case, and maybe just the ghosts of unix past... Lemme think about it though...

lib/libc/gen/getttyent.c
112 ↗(On Diff #26334)

Thanks for the history. I certainly appreciate some amount of paranoia about "the ghosts of Unix past". :)

This revision was automatically updated to reflect the committed changes.