docs/82296: ttys(5) man page misleads about use for non-getty processes
Chris Lightfoot
chris at ex-parrot.com
Wed Jun 15 21:50:16 UTC 2005
>Number: 82296
>Category: docs
>Synopsis: ttys(5) man page misleads about use for non-getty processes
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jun 15 21:50:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Chris Lightfoot
>Release: 5.2.1-RELEASE-p13
>Organization:
>Environment:
FreeBSD very.unfortu.net 5.2.1-RELEASE-p13 FreeBSD 5.2.1-RELEASE-p13 #5: Wed Dec 29 16:45:15 GMT 2004 james at very.unfortu.net:/usr/obj/usr/src/sys/VERY i386
>Description:
The ttys(5) man page states in respect of each line of /etc/ttys,
The first field is normally the name of the terminal special file as it
is found in /dev. However, it can be any arbitrary string when the asso-
ciated command is not related to a tty.
However, this is not true -- the new_session command in init.c will drop any /etc/ttys line whose first field does not give the name of a file in /dev which can be opened: (line 937 et seq)
/*
* Attempt to open the device, if we get "device not configured"
* then don't add the device to the session list.
*/
if ((fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0)) < 0) {
if (errno == ENXIO || errno == ENOENT) {
free_session(sp);
return (0);
}
} else
close(fd);
The same error is present in ttys(5) in the 5.4-RC2 release in respect of the init source code on that release.
>How-To-Repeat:
Obey advice of man page to run a non-getty process from init; observe that it doesn't work.
>Fix:
Change the man page or the code in init.c. The latter looks harder since I don't think init.c knows whether a given line refers to a getty process or not.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list