tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: terminal setup

On Thu, 21 Mar 2013, Emmanuel Dreyfus wrote:
I am trying to run an install script from /etc/rc.local and run into terminal setup problem: the last line outuput by the script is not displayed until the user hit return (which is not very helpful if the scipt asks questions).

This is probably an artefact of the way /etc/rc pipes output into a postprocessor. Your script is run on the left hand side of a pipeline whose right hand side reads a line at a time and decides whether to copy the line to the terminal, display a rotating "twiddle" on the terminal, copy the line to the log file, or some combination of these. See "Operation of rc", step 5, in rc(8), and see "rc_silent" in rc.conf(8).

Try adding "KEYWORD: interactive" to the top of the script, near the BEFORE/AFTER/REQUIRE/PROVIDE lines used by rcorder. See /etc/rc.d/ for an example. That will make /etc/rc run the script without postprocessing; the advantage is that output will appear immediately, even if it's a partial line like a prompt, end even if rc_silent is true; the disadvantage is that output will not appear in /var/run/rc.log. This is poorly documented; you have to read rc.subr(8) very carefully to figure it out. We also don't have a good way of getting the advantages of "KEYWORD: interactive" without its disadvantages.

--apb (Alan Barrett)

Home | Main Index | Thread Index | Old Index