Univention Bugzilla – Bug 40596
option to configure serial access (serial console) via ucr
Last modified: 2016-05-04 18:19:11 CEST
Excerpt from http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO For the average user a serial console has no advantage compared to a graphical console offered by a directly attached keyboard and screen. But there are some scenarios where serial consoles are useful: * Systems administration of remote computers Usually done by using SSH, but there are times when access to the console is the only way to diagnose and correct software failures. * High density racks of computers * Recording console messages For us the reason to use a serial console is that also handicapped (blind) administrators who need to work on it but can not do anything with a graphical output. See also: http://forum.univention.de/viewtopic.php?f=48&t=4818 current UCS situation: It is technically possible to configure a serial console in "UCS servers" (of course: Finally, it is linux, so you can do virtually anything *smile*), but Univention template files must be manually adjusted, which is bad for updates. There is no "Univention Documentation" how to configure serial access to a server. So the aims of this bug report are: * serial access is completely configurable via ucr * Some basic documentation "how to configure serial console in UCS servers" is available I'm going to write a patch against grub that enables the above-described and write some basic documentation. Short note: You already own the signed declaration to participate in the development of UniventionSoftware (German: "Mitwirkungserklärung") So the code/docs can be used as you desire. Best regards Lutz Willek
Created attachment 7457 [details] defines new ucr variable "grub/terminal" and "grub/serialcommand" # patch /etc/univention/registry.info/variables/univention-grub.cfg <univention-grub.cfg.patch
Created attachment 7458 [details] enhances grub configuration by using "grub/terminal" and "grub/serialcommand" variables patch /etc/univention/templates/files/etc/default/grub <grub.patch
Testcases ========= Preparation ----------- * Apply patches 7457 and 7458 * Create a backup of existing configuration files # cp /etc/default/grub /etc/default/grub_ORIG # cp /boot/grub/grub.cfg /boot/grub/grub.cfg_ORIG Testcase 0 ---------- * aim: check new variables # ucr info grub/terminal grub/terminal: <empty> Select the terminal device. Default: <empty> (graphical terminal is allowed). Set to "console" to disable graphical terminal. Set to "console serial" to also enable serial output. Documentation: http://www.gnu.org/software/grub/manual/grub.html Categories: system-base # ucr info grub/serialcommand grub/serialcommand: <empty> Configures the serial port when using the serial console. Default: <empty>. Example: "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1". Note: The serial port is not used as a communication channel unless a terminal is configured (see grub/terminal) Documentation: http://www.gnu.org/software/grub/manual/grub.html Categories: system-base --> success Testcase 1 ---------- * aim: existing systems: No configuration should be changed # ucr commit /etc/default/grub # diff /etc/default/grub_ORIG /etc/default/grub 31,32c31,35 < # Uncomment to disable graphical terminal (grub-pc only) < #GRUB_TERMINAL=console --- > # Configure UCR Variable "grub/terminal" to disable graphical terminal (grub-pc only)' > #GRUB_TERMINAL="console" > > # Configure UCR Variable "grub/serialcommand" to adapt GRUB_SERIAL_COMMAND settings > #GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" # diff /boot/grub/grub.cfg_ORIG /boot/grub/grub.cfg ; echo $? 0 --> success. No configuration will be changed Testcase 2 ---------- * aim: disable graphical output of grub, enable text output # ucr set grub/terminal='console' Create grub/terminal # ucr commit /etc/default/grub # diff /etc/default/grub_ORIG /etc/default/grub 31,32c31,35 < # Uncomment to disable graphical terminal (grub-pc only) < #GRUB_TERMINAL=console --- > # Configure UCR Variable "grub/terminal" to disable graphical terminal (grub-pc only)' > GRUB_TERMINAL="console" > > # Configure UCR Variable "grub/serialcommand" to adapt GRUB_SERIAL_COMMAND settings > #GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" # diff /boot/grub/grub.cfg_ORIG /boot/grub/grub.cfg |grep 'terminal' < terminal_output gfxterm > terminal_input console > terminal_output console # init 6 --> watch grub output, should be "text only" --> success Testcase 3 ---------- * aim: revert of "Testcase 2" # ucr unset grub/terminal Unsetting grub/terminal # ucr commit /etc/default/grub # diff /etc/default/grub_ORIG /etc/default/grub 31,32c31,35 < # Uncomment to disable graphical terminal (grub-pc only) < #GRUB_TERMINAL=console --- > # Configure UCR Variable "grub/terminal" to disable graphical terminal (grub-pc only)' > #GRUB_TERMINAL="console" > > # Configure UCR Variable "grub/serialcommand" to adapt GRUB_SERIAL_COMMAND settings > #GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" # diff /boot/grub/grub.cfg_ORIG /boot/grub/grub.cfg ; echo $? 0 --> success. Testcase 4 ---------- * aim: configure serial access # ucr set grub/terminal='console serial' Setting grub/terminal # ucr commit /etc/default/grub # diff /boot/grub/grub.cfg_ORIG /boot/grub/grub.cfg |grep 'terminal' < terminal_output gfxterm > terminal_input console serial > terminal_output console serial # diff /etc/default/grub_ORIG /etc/default/grub 31,32c31,35 < # Uncomment to disable graphical terminal (grub-pc only) < #GRUB_TERMINAL=console --- > # Configure UCR Variable "grub/terminal" to disable graphical terminal (grub-pc only)' > GRUB_TERMINAL="console serial" > > # Configure UCR Variable "grub/serialcommand" to adapt GRUB_SERIAL_COMMAND settings > #GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" # init 6 --> Connect via serial console (ttyS0) *and* the attached monitor and keyboard. Hint: The serial connection is being made at 115200/8n1, on first serial port Hint: Default fallback if your hardware does not support 115200 baud is 9600/8n1 --> Observe the (nearly) simultaneous output to the attached monitor and serial console --> Try to change grub menu settings with via both, keyboard and serial console --> Try to boot via serial console connected and *without* connected monitor/keyboard --> Try to boot via connected monitor/keyboard and *without* serial console --> success. Testcase 5 ---------- * aim: configure serial access, change serial settings to second port (ttyS1) # ucr set grub/terminal='console serial' Setting grub/terminal # ucr set grub/serialcommand='serial --unit=1 --speed=115200 --word=8 --parity=no --stop=1' Create grub/serialcommand # ucr commit /etc/default/grub # diff /etc/default/grub_ORIG /etc/default/grub 31,32c31,35 < # Uncomment to disable graphical terminal (grub-pc only) < #GRUB_TERMINAL=console --- > # Configure UCR Variable "grub/terminal" to disable graphical terminal (grub-pc only)' > GRUB_TERMINAL="console serial" > > # Configure UCR Variable "grub/serialcommand" to adapt GRUB_SERIAL_COMMAND settings > GRUB_SERIAL_COMMAND="serial --unit=1 --speed=115200 --word=8 --parity=no --stop=1" # diff /boot/grub/grub.cfg_ORIG /boot/grub/grub.cfg |grep 'terminal' < terminal_output gfxterm > terminal_input console serial > terminal_output console serial # init 6 --> Connect via serial console (ttyS1) --> success Testcase 6 aim: Accidental setting of "grub/serialcommand" without adjustments to "grub/terminal" No configuration should be changed # ucr unset grub/terminal Unsetting grub/terminal # ucr unset grub/serialcommand Unsetting grub/serialcommand # ucr set grub/serialcommand='serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1' Create grub/serialcommand # ucr commit /etc/default/grub # diff /etc/default/grub_ORIG /etc/default/grub 31,32c31,35 < # Uncomment to disable graphical terminal (grub-pc only) < #GRUB_TERMINAL=console --- > # Configure UCR Variable "grub/terminal" to disable graphical terminal (grub-pc only)' > #GRUB_TERMINAL="console" > > # Configure UCR Variable "grub/serialcommand" to adapt GRUB_SERIAL_COMMAND settings > GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" # diff /boot/grub/grub.cfg_ORIG /boot/grub/grub.cfg ; echo $? 0 --> success ==> all tests successfully finished.
Dear Uninvention , please review the submitted patches and testcases and, if possible, apply to the next UCS 4.1 errata patch. Best Regards Lutz Willek
r68737 | Apply patches Thanks Lutz. r68744 | Bug #40596 grub: Fix UCR variable registration Package: univention-grub Version: 9.0.1-7.135.201604190607 Branch: ucs_4.1-0 Scope: errata4.1-1 r68745 | Bug #40596 grub: Fix UCR variable registration YAML univention-grub.yaml
Code review: OK Advisory: OK Tests: OK
<http://errata.software-univention.de/ucs/4.1/171.html>