System profile versioning Introduction 11.. IInnttrroodduuccttiioonn System profile versioning may have different usages. This solves various problems related with the complexity of managing workstations and servers. Do you have a notebook computer ? Have you ever wished to have one set of configuration files for the office and one for the home and yet another one for a customer site ? And be able to switch at will between those configurations, even at boot time ? Yet, you wish be able to share some aspect of the system configuration in all three locations. Are you doing things more and more complicate with _L_i_n_u_x these days ? Have you ever wish to be able to freeze a working setup and then experiment with new settings while all the users are away ? Have you ever been caught very late at night with a non-working setup ? The user will be back in a few hours and you are not able to get back to the working state you had when you attempted to enhance the system. Well, if you answer yes to any of those question, then _S_y_s_t_e_m _p_r_o_f_i_l_e _v_e_r_s_i_o_n_i_n_g is for you. 11..11.. DDeeffiinniittiioonn ooff aa ssyysstteemm pprrooffiillee A system profile is defined by a set of configuration files. Those configuration files belong to various sub-systems. Sometime a file even belongs to two or more sub-systems. 11..22.. SSyysstteemm pprrooffiillee vveerrssiioonn A version is a collection of all configuration files which define a specific state of your computer. By switching profile version, you are effectively saving the current configuration file into a special storage area (/etc/linuxconf/archive) and restoring files from the new activated version. 11..33.. SShhaarriinngg ffiilleess bbeettwweeeenn ttwwoo ssyysstteemm pprrooffiillee vveerrssiioonnss Swapping all configuration files from a working profile and replacing them by other configuration files is not always useful. For example you might define two system profile version: One for the office and one for the home. Some sub-systems are identical for both environment and you expect that when you maintain one aspect of you Linux notebook at home, those change will be available at the office next morning. Sometime you expect the two environment to evolve separately. In fact, you need control sub-system per sub-system on how things are saved/restored between various system profile versions. 11..44.. AArrcchhiivviinngg tteecchhnnoollooggyy _L_i_n_u_x_c_o_n_f use the _R_C_S system to save copies of the various files. RCS is used to keep an history of the state of the configuration files. This will be used one day in Linuxconf to create audit reports showing how various sub-systems were managed over time. The archiving technology might evolve one day to use an archive server. This would allows one to track efficiently the configuration changes of many workstation and servers. 22.. SSyysstteemm pprrooffiillee ddeeffiinniittiioonn Here is how to define a version. 22..11.. AA nnaammee Each system profile version has a name which is used to select it. The name does not contain any space. 22..22.. AA ttiittllee You can give a title to make menus nicer to read. 22..33.. DDeeffaauulltt aarrcchhiivviinngg ffaammiillyy Any sub-system without an archiving family will be archived using this one. Most of the time, system profile version are archived in one or two different family. This avoid repeating the archiving family over and over. 22..44.. AArrcchhiivviinngg ffaammiilliieess A system profile version is defined by telling Linuxconf how the various sub-systems composing it are archived. Or where they are archived. Sub-systems configuration files are archived in a family together. If two system profile versions are defined so they archive one given sub-system in the same family, then the configuration files for this sub-system will be shared between the two versions. This means that a change done while a given system profile verison is active will be available when you switch to the other system profile. Switching between the two versions won't affect the state of this specific sub- system. A family is just a single word. It can be any word. It becomes a subdirectory in /etc/linuxconf/archive. In this subdirectory, you will find archived copies of the various configuration file saved there. Inside the family directory, you find a directory hierarchy that duplicate the various directories normally found in a Linux system, such as /etc and /etc/ppp. Several sub-systems may be archived in the same family. 33.. SSppeecciiaall aarrcchhiivviinngg ffaammiillyy:: nnoonnee Selecting none as the archiving family means you don't want archiving at all for this subsystem. 44.. DDeeffaauulltt sseettttiinnggss When you enter the profile versioning dialog, you see that Linuxconf has already defined two profile versions: One is called Office and the other Home. Both are defined to archived every sub-system except one into the family Home-Office. The sub-systems "station identity" and "network connectivity" are archived in the "Home" family for the version Home and are archived in the "Office" family for the Office version. This two setting should be good enough for notebook users who travel between the home and the office. 55.. UUssiinngg yyoouurr oowwnn aarrcchhiivveerr Linuxconf use the script /usr/lib/linuxconf/lib/cfgarchive to save and extract the various configuration file. This script is documented (commented). You can specify another archive command by going in the "Control file and systems" menu and then the "All commands and daemon". Locate the cfgarchive command and enter the path of a replacement command. 66.. MMaannaaggiinngg ssyysstteemm pprrooffiilleess One system profile versions are defined, you can switch back and forth between them. Linuxconf preserves the configuration files for all sub- systems that are not shared between the two version. After that it restore the configuration files for the newly selected version. 66..11.. UUssiinngg tthhee ccoonnttrrooll ppaanneell In the control panel, you find the menu entry _s_w_i_t_c_h _s_y_s_t_e_m _v_e_r_s_i_o_n. This menu presents you the list of all version available (except the currently active one). You just pick one and here you are. You may want to visit the _A_c_t_i_v_a_t_e _c_h_a_n_g_e_s menu of the control panel or leave Linuxconf so the new configuration are brought in action. 66..22.. AAtt bboooott ttiimmee At boot time, an option let you select the proper profile version. As with the option in the control panel, this involves archiving the current version and restoring the new one. Linuxconf may then boot using the new configuration files. 66..33.. FFrroomm tthhee ccoommmmaanndd lliinnee Limited functionality are available from the command line to play with the archiving. Both command line option only work on the current version. They are handy to do some experiment and undo them. Remember that _R_C_S is used to save the files. This means that you can extract a very old copy of a configuration file if needed. _L_i_n_u_x_c_o_n_f does not support this yet though. You have to dig in /etc/linuxconf/archive. 66..33..11.. AArrcchhiivviinngg ssoommee oorr aallll ssuubb--ssyysstteemmss The command linuxconf --archive [ sub-system ... ] lets you save a copy of the configuration file of few sys-systems. If you omit to name sub-system, then all sub-systems are archived. 66..33..22.. AArrcchhiivviinngg ssoommee oorr aallll ssuubb--ssyysstteemmss The command linuxconf --extract [ sub-system ... ] lets you restore the configuration file of few sys-systems. If you omit to name sub-system, then all sub-systems are restored.