1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
|
<!doctype linuxdoc system>
<article>
<title>System profile versioning
<sect>Introduction
<p>
System profile versioning may be used for different purposes, to solve
various problems related to the complexity of managing
workstations and servers. Read the following questions to see if any of
them apply to you.
Do you have a notebook computer?
Have you ever wished to have one set of configuration files:
one for the office, one for the home and yet another one
for a customer's site? Would you like to be able to switch at
will between these configurations, even at boot time?
Yet, you want to be able to share some aspects of the system configuration
in all three locations.
Are you doing more and more complicated things with <em/Linux/
these days?
Have you ever wished 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 <em/System
profile versioning/ is for you.
<sect1>Archiving mode
<p>
A checkbox controls the way archiving is performed. By default,
archiving of a profile is done either when you switch to another
profile or you trigger an archive operation.
Archiving may be performed every time you modify a configuration file.
The archiving is done just before the file is updated. That way,
the archive always contains the original version before you
updated it. Using RCS or the --diff command line option, you can
track the evolution of the configuration file. See the --diff
option below.
<sect1>Definition of a system profile
<p>
A system profile is defined by a set of configuration files. These
configuration files belong to various subsystems. Sometimes a file
even belongs to two or more subsystems.
<sect1>System profile version
<p>
A version is a collection of all configuration files which define
a specific state of your computer. By switching profile versions, you
are effectively saving the current configuration files into
a special storage area (<TT>/etc/linuxconf/archive</TT>) and restoring
files from the newly activated version.
<sect1>Sharing files between two system profile versions
<p>
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 versions: one for the office and
one for the home. Some subsystems are identical for both
environments. You expect that when you maintain one aspect of
your Linux notebook at home, those changes will be available at the
office the next morning.
Sometimes you expect the two environments to evolve separately. In
fact, you need control subsystem by subsystem over how things are
saved/restored between various system profile versions.
<sect1>Archiving technology
<p>
<em/Linuxconf/ use the <em/RCS/ system to save copies of the various
files. RCS is used to keep a history of the state of the configuration
files. This will be used one day in Linuxconf to create audit reports
showing how various subsystems were managed over time.
The archiving technology might evolve one day to use an archive server.
This would allow one to track efficiently the configuration changes
of many workstations and servers.
<sect>System profile definition
<p>
Here is how to define a version.
<sect1>A name
<p>
Each system profile version has a name which is used to select it.
The name does not contain any spaces.
<sect1>A title
<p>
You can give a title to make menus easier to read.
<sect1>Default archiving family
<p>
Any subsystem without an archiving family will be archived using
this default family. Most of the time, system profile versions are archived
in one or two different families. This avoids repeating the archiving
family over and over.
<sect1>Archiving families
<p>
A system profile version is defined by telling Linuxconf how or
where the various sub-systems composing it are archived.
Sub-system configuration files are archived in a family
together.
If two system profile versions are defined so they archive one given
subsystem in the same family, then the configuration files
for this subsystem will be shared between the two versions. This
means that a change done while a given system profile version 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 subsystem.
A family is just a single word. It can be any word. It becomes a
subdirectory in <TT>/etc/linuxconf/archive</TT>. In this subdirectory,
you will find archived copies of the various configuration files. Inside
the family directory, you will find a directory hierarchy that
duplicates the various directories normally found in a Linux system,
such as <TT>/etc</TT> and <TT>/etc/ppp</TT>.
Several subsystems may be archived in the same family.
<sect>Special archiving family: none
<p>
Selecting none as the archiving family means you don't want any
archiving at all for this subsystem.
<sect>Default settings
<p>
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 archive every subsystem except one in the
family Home-Office. The subsystems "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. These two
settings should be good enough for notebook users who travel between the
home and the office.
<sect>Using your own archiver
<p>
Linuxconf use the script <TT>/usr/lib/linuxconf/lib/cfgarchive</TT> to save
and extract the various configuration files. This script is
documented (commented). You can specify another archive
command by going in the "Control file and systems" menu followed by
the "All commands and daemon" menu. Locate the cfgarchive command and
enter the path of a replacement command.
<sect>Managing system profiles
<p>
Once 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 restores the configuration files for the newly selected version.
<sect1>Using the control panel
<p>
In the control panel, you find the menu entry <em/switch system
version/. This menu presents you with the list of all versions
available (except the currently active one). You just pick one
and there you are.
You may want to visit the <em/Activate changes/ menu of the control
panel or leave Linuxconf so the new configuration is brought into
action.
<sect1>At boot time
<p>
At boot time, an option lets 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. This is handled by
the optional boot time menu (Some distribution are not installing
it unfortunatly).
It is also possible to switch profile from the LILO prompt. You simply
pass the PROFILE=profile-name argument to the selected kernel. For
example:
<tscreen><verb>
LILO boot: linux PROFILE=home
</verb></tscreen>
<sect1>From the command line
<p>
Limited functionality is available from the command line to
play with the archiving. Both command line options only work on
the current version. They are handy to do some experiments and
undo them. Remember that <em/RCS/ is used to save the files. This
means that you can extract a very old copy of a configuration file
if needed. <em/Linuxconf/ does not yet support this however. You have
to dig in the /etc/linuxconf/archive.
<sect2>Archiving some or all subsystems
<p>
The command
<tscreen><verb>
linuxconf --archive [ sub-system ... ]
</verb></tscreen>
lets you save a copy of the configuration files of a few subsystems.
If you omit a subsystem name, then all subsystems are archived.
<sect2>Comparing the current setting with the archive
<p>
The command
<tscreen><verb>
linuxconf --diff [ sub-system ... ]
</verb></tscreen>
lets you compare the current state of a the configuration files
with the last archived version.
If you omit a subsystem name, then all subsystems are compared.
<sect2>Extracting some or all subsystems
<p>
The command
<tscreen><verb>
linuxconf --extract [ sub-system ... ]
</verb></tscreen>
lets you restore the configuration files of a few sys-systems.
If you omit a subsystem name, then all subsystems are restored.
<sect2>Viewing the status of the RCS archive
<p>
The command
<tscreen><verb>
linuxconf --history [ sub-system ... ]
</verb></tscreen>
will present the archiving history of every file in the
subsystems (or all subsystems). It does this by executing the
rlog command on each file in the archive.
</article>
|