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)
Mon, Oct 28, 7:22 AM
Unknown Object (File)
Fri, Oct 25, 4:17 PM
Unknown Object (File)
Oct 5 2024, 4:29 AM
Unknown Object (File)
Oct 4 2024, 6:50 PM
Unknown Object (File)
Oct 4 2024, 4:05 PM
Unknown Object (File)
Sep 27 2024, 1:10 PM
Unknown Object (File)
Sep 9 2024, 12:50 AM
Unknown Object (File)
Sep 7 2024, 6:07 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.