04/04/96 Startup Output Sent to File & Console SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. ABOUT THIS DOCUMENT This script captures the output from programs and scripts started in the /etc/inittab and sends this output to a file and to the console. The syntax is: swconsole /name/of/file /name/of/tty swconsole /tmp/rc.out /dev/console This has been tested on both AIX 3.2.5.1 and 4.1.3. Results may vary depending upon your exact configuration. WARNING: Before using this on a production system Test this script first. WARNING: Since this script becomes part of the startup process, you must have tested alternate boot media available in case of a problem. for each script or program in the /etc/inittab file you wish to monitor, for example the /etc/rc entry looks like this: rc:2:wait:/etc/rc > /dev/console 2>&1 # Multi-User checks change it to read: rc:2:wait:/etc/rc 2>&1 | swconsole /tmp/rc.out /dev/console # Mulit-User ckecks. For aix 4.1, the utility alog has been provided and can be used instead of this script. It will provide a more detailed output of what the script is doing. See the /etc/inittab file for examples of its syntax or see InfoExplorer for more details on the alog command. Startup Output Sent to File 1 Console 1 04/04/96 WARNING: Use at your own risk. #!/usr/bin/ksh # swconsole /usr/bin/awk -v FILE="$1" -v OUTPUT="$2" ' { output_file=sprintf("%s",FILE) screen_output=sprintf("%s",OUTPUT) printf("%s\n",$0) >>output_file printf("%s\n",$0) >>screen_output }' >/dev/null Startup Output Sent to File 2 Console 2 04/04/96 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (swconsole.boot.cmd) Startup Output Sent to File 3 Console 3