January 2010 Archives

Behind the scenes of YaST

| 19 Comments

SUSE has long used YaST as a management tool. It makes it easy to make changes to your system without knowing (or caring) what happens behind the scenes.

At Guru Labs, our Linux Training is all about teaching students what happens "behind the scenes". We strive to document the official and best practice techniques (not always the same thing, unfortunately).

Recently we were updating our courseware and wanted to document how to disable IPv6 in the various Enterprise Linux distributions. The question came up, "What does YaST actually do when you toggle the Enable/Disable IPv6 checkbox in the YaST network module." To answer that question I performed the following steps on SLES11.

Search for the string IPv6 in the YaST network module.

grep -n IPv6 $(rpm -ql yast2-network)

In the output, found these lines looked interesting (Note the Disable/Enable strings)

/usr/share/YaST2/modules/Lan.ycp:316:global void SetIPv6(boolean status){
/usr/share/YaST2/modules/Lan.ycp:324:void writeIPv6(){
/usr/share/YaST2/modules/Lan.ycp:424: writeIPv6();
/usr/share/YaST2/modules/Lan.ycp:654: status_v6 = _("Support for IPv6 protocol is enabled");
/usr/share/YaST2/modules/Lan.ycp:656: link_v6 = Hyperlink (href_v6, _("Disable IPv6"));
/usr/share/YaST2/modules/Lan.ycp:662: status_v6 = _("Support for IPv6 protocol is disabled");
/usr/share/YaST2/modules/Lan.ycp:664: link_v6 = Hyperlink (href_v6, _("Enable IPv6"));


Based on my experience I guessed that the writeIPv6 function does the work of enabling and disabling IPv6 on the system.

So I took a look at that function using the line number found by grep:

vim /usr/share/YaST2/modules/Lan.ycp +324

I found the following:

void writeIPv6(){
SCR::Write(.target.string, "/etc/modprobe.d/ipv6", sformat("%1install ipv6 /bin/true", ipv6?"#":""));
SCR::Write(.sysconfig.windowmanager.KDE_USE_IPV6, ipv6?"yes":"no");
}

That pointed me at the two files "/etc/modprobe.d/ipv6" and "/etc/sysconfig/windowmanger".

Looking at the files it seems YaST simply removes/adds the comment character in front of the one-and-only line in the file /etc/modprobe.d/ipv6 and it toggles the variable KDE_USE_IPV6 in /etc/sysconfg/windowmanager.

If you ever have the need to discover what YaST is doing behind the scenes, you can use the same technique.

About this Archive

This page is an archive of entries from January 2010 listed from newest to oldest.

November 2009 is the previous archive.

March 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.