openSUSE:YaST debugging
This page partially overlaps with How to report a bug in YaST where you also find some debugging tips.
Logs
The logs are in /var/log/YaST2. The primary log file is y2log which is rotated to y2log-[1-9]. If YaST is run as non-root, the logs are ~/.y2log, ~/.y2log-[1-9].
If you need to see what steps the user took during the installation, look in macro_inst_initial.ycp and macro_inst_cont.ycp in the log directory. These are UI macros that are automatically recorded during the installation and they show what values were entered in the widgets (with passwords masked out) and what buttons were pressed. (You can invoke this facility yourself in yast2-qt by Ctrl-Alt-Shift-M and Ctrl-Alt-Shift-P.)
More Log Messages
Debugging log messages can be enabled in several ways:
- Y2DEBUG=1
- this is an environment variable. Use like Y2DEBUG=1 /sbin/yast2 lan. It also works on the kernel command line during the installation.
- UI dialog
- Press Shift-F7 in the Qt UI to switch the debugging messages at run time.
- signal
- Send the y2base process a USR1 signal to toggle debug logging. killall -USR1 y2base
There also are environment variables for controlling the level of logging libzypp (package management library used by YaST) events:
- ZYPP_MEDIA_CURL_DEBUG=1
- enables logging of detailed CURL information. Useful for debugging network-related problems with installation or package management.
strace
Strace is very useful for debugging YaST and other programs too. Here are the basics.
This is a frequently useful line: Y2DEBUG=1 strace -eopen -ostrace.log /usr/lib/YaST2/bin/y2base lan qt.
gdb
See the gdb manual.
A complication in debugging YaST is that it loads its components dynamically which means that when you want to set a breakpoint in a part of the code, the code is not loaded yet. The way around it is to set auxilliary breakpoints in crucial places:
- main
- ScriptingAgent
openSUSE 11.0 Alpha 3 will have the debugging feature to start YaST from gdb during installation. To activate this feature append "Y2GDB=1" on kernel command line while booting.
- When using Qt: The X-server starts on console 7 as usual but will remain black until you start YaST manually. Do so by switching to console 1 where gdb is running. Type "run" to start YaST. Switch back to console 7 to see the UI of YaST.
- When using ncurses: Gdb starts on console 1. Type "run" to start YaST. Switch to console 10 to see the UI of YaST.
When YaST finishes you have to type "quit" in gdb to continue with the installation.
Debugging installation
Sometimes you may want to add more debugging output to some of the installation clients, you need certain debuginfo package during installation, or you want to use some package that is not by default in inst-sys. For all these, you need to create customized installation source . It is also useful for testing whether a patch or newly built rpm really fixes a bug in installation before new package becomes available on the official media
Opening a shell during the installation
It is often useful to open root shell during the installation and issue some debugging commands. From the graphical YaST installation, you can use Ctrl+Alt+Shift+X to get an X terminal with a root shell. On a hardware (non-local) console it is also possible to switch to hardware console 2 (with Ctrl+F2 in text mode, Ctrl+Alt+F2 in graphical mode) where a root shell exists.