From owner-freebsd-doc Sun Sep 26 17: 0: 5 1999 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 07B0E14C83 for ; Sun, 26 Sep 1999 17:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id RAA28076; Sun, 26 Sep 1999 17:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sun, 26 Sep 1999 17:00:01 -0700 (PDT) Message-Id: <199909270000.RAA28076@freefall.freebsd.org> To: freebsd-doc@freebsd.org Cc: From: Peter Jeremy Subject: Re: bin/12767: Expand /etc/ttys manpage Reply-To: Peter Jeremy Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/12767; it has been noted by GNATS. From: Peter Jeremy To: sheldonh@FreeBSD.ORG Cc: gnats@FreeBSD.ORG Subject: Re: bin/12767: Expand /etc/ttys manpage Date: Mon, 27 Sep 1999 09:43:52 +1000 Hi Sheldon, After contemplating both ttys(5) and init(8), my latest suggestion is the following: Index: src/libexec/getty/ttys.5 =================================================================== RCS file: /home/CVSROOT/src/libexec/getty/ttys.5,v retrieving revision 1.10 diff -u -r1.10 ttys.5 --- ttys.5 1999/08/28 00:09:37 1.10 +++ ttys.5 1999/09/26 23:42:57 @@ -56,9 +56,11 @@ are delimited by hash marks (``#'') and new lines. Any unspecified fields will default to null. .Pp -The first field is the +The first field is normally the name of the terminal special file as it is found in .Pa /dev . +It can be, however, any arbitrary string when the associated command is not +related to a tty. .Pp The second field of the file is the command to execute for the line, usually @@ -125,6 +127,14 @@ "none". For backwards compatibility, the ``group='' should appear last on the line, immediately before the optional comment. +.Pp +Both the second field and any command specified with ``window='' +will be split into words and executed using +.Xr execve 2 . +Words are separated by tabs and/or spaces. +Arguments comprised of more than one word should be enclosed in single +quotes ("'"). +Note that no shell-style globbing or other variable substitution occurs. .Sh EXAMPLES .Bd -literal # root login on console at 1200 baud Index: src/sbin/init/init.8 =================================================================== RCS file: /home/CVSROOT/src/sbin/init/init.8,v retrieving revision 1.19 diff -u -r1.19 init.8 --- init.8 1999/09/06 08:41:32 1.19 +++ init.8 1999/09/26 23:42:57 @@ -152,7 +152,11 @@ processes for the terminal ports found in the file .Xr ttys 5 . .Nm Init -reads this file, and executes the command found in the second field. +reads this file, and executes the command found in the second field, +unless the first field refers to a device in +.Pa /dev +which is not configured. +The first field is supplied as the final argument to the command. This command is usually .Xr getty 8 ; .Nm getty @@ -182,6 +186,17 @@ .Nm getty for the line. .Pp +.Nm Init +can also be used to keep arbitrary daemons running - automatically +restarting them if they die. +In this case, the first field in the +.Xr ttys 5 +file can specify any arbitrary string (though it will be passed to +the daemon on its command line). +This is similar to the facilities offered in the +.At V +.Pa /etc/inittab . +.Pp Line status (on, off, secure, getty, or window information) may be changed in the .Xr ttys 5 @@ -205,10 +220,8 @@ .Xr ttys 5 file and are now on, .Nm -executes a new -.Nm getty -to enable a new login. -If the getty or window field for a line is changed, +executes the command specified in the second field. +If the command or window field for a line is changed, the change takes effect at the end of the current login session (e.g., the next time .Nm @@ -238,8 +251,7 @@ will time out after 30 seconds and print a warning message. .Pp .Nm Init -will cease creating new -.Nm getty Ns 's +will cease creating new processes and allow the system to slowly die away, if it is sent a terminal stop .Pq Dv TSTP signal, i.e. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message