2004.05_Managing System Configurations with System Configuration Profile Management.pdf
(
2996 KB
)
Pobierz
Layout 1
COVER STORY
SCPM
Environment Changing
Changing the operating environment
on a single machine, involves a lot of
configuration work. SCPM makes life
easier for Suse users by maintaining
profiles with different settings.
BY FALKO ZURELL
world of laptops. Portable machines
are especially prone to environment
changes. Although you typically hitch up
your laptop to the wired network to con-
nect to the outside world, you might use
a WLAN from time to time, or not have a
network connection at all. Although you
have a docking station with an external
screen at the office, at home you might
revert to the built-in display. Suse Linux
has SCPM, the System Configuration
Profile Management tool, to help your
machine adapt to its surrounds.
ent environment with a single com-
mand. As an alternative, you can simply
select a profile on booting.
SCPM has been a default Suse compo-
nent since version 8. Assuming you have
not manually deleted SCPM, the profile
manager should already be installed on
your Suse system.
The GUI-based YaST
Profile manager
module, which is located in the
System
group, helps you set up SCPM (see Fig-
ure 1), but you can also enter
yast2
profile-manager
to launch the tool
directly.
Existing profiles are displayed in the
profile manager’s main window. You can
add a new profile or modify the configu-
ration. The
Options
button allows you to
change or create resource groups (see
Figure 2).
Your current configuration is used as a
template when you create a new profile.
SCPM creates a directory with the new
profile name below
/var/lib/scpm/pro-
files/
, and copies the configuration files
for the specified resource groups to that
directory.
Groups
Admins can use resource groups to spec-
ify the services to which the profile
settings apply. SCPM only saves your
printer settings if you enable the
printer
group, for example. If you do not check
this resource, the printer is not affected
by a profile change, but simply keeps its
current settings.
A few pre-defined resource groups are
created when you install SCPM. These
groups cover most configurations and
include basic network settings (
net-
work
), the NTP service for time
synchronization across the Internet
(
ntpd
), the firewall (
SuSEfirewall2
), the
autofs
automounter, which automati-
cally mounts disks. If this selection is not
to your liking, you can define your own
groups.
Unfortunately, the status display in the
main window of the YaST module is not
Sharp Profiles
SCPM saves complete collections of sys-
tem settings for various environments in
so-called profiles, allowing you to restore
them when needed. Profiles not only
store configuration files, but also addi-
tional information – such as whether
specific services have been enabled, or
not. That makes it possible to perform all
the changes required to adapt to a differ-
Table 1: SCPM Commands
Listing 1: Accessing SCPM’s database mode
and creating a new resource
Enable SCPM
scpm enable
Create a new profile
scpm add profile_name
Switch to another profile
scpm switch profile_name
Save the changes to the active profile
scpm save
Copy a profile
scpm copy source_profile target_profile
Display the active profile
scpm active
Display available profiles
scpm list
Reload the settings of the current profile
scpm reload
01 #
scpm db
02 SCDB Utility (SCPM version 0.9.4)
03 >
load
04 >
create resource /opt/tomcat/conf/server.xml file
05 >
save
06 >
quit
30
May 2004
www.linux-magazine.com
Managing system configurations with SCPM
L
inux is making inroads into the
SCPM
COVER STORY
Figure 1: YaST2 helps you configure SCPM.
Figure 2: SCPM Yast2 module – resource configuration.
reliable. It insists that the profile man-
ager is disabled, irrespective of its actual
status. Doubly enabling a profile should
not cause any harm, as SCPM does not
overwrite existing databases or profiles.
Or at least it requires you to explicitly
stipulate an overwrite in the command
line.
There are more or less no limits to
expanding the profile manager’s capabil-
ities, as you can tell SCPM to launch
pre-start
and
post-start
or
pre-stop
and
post-stop
scripts when loading or unload-
ing a profile (see Figure 3).
When you select a different profile,
SCPM first runs the two stop scripts, and
alerts you in case of unsaved changes. It
then goes on to launch the pre-start
script, retrieves the configuration files
for the new profile from the database,
and applies them to the system. SCPM
checks if services are running or not, and
ensures that the required status is
applied. The last step of the change
process is to call the post-stop script.
If you want to specify a profile when
booting a machine, you can stipulate
the
PROFILE=profile_name
parameter in
the boot menu to tell Suse to fire up
with the required settings. The
/etc/init.d/boot.scpm
script ensures that
this works.
If you regularly change your profile on
booting, you might like to add a few
entries with pre-configured kernel
parameters to your bootloader confi-
guration (YaST2:
System / Bootloader
Configuration
). To do so, add a new
section with the settings for the default
kernel and simply change the
PROFILE
parameter to load the required profile the
next time you boot.
mode. (see Listing 1). The
load
com-
mand is extremely important here, as it
loads the current database for editing. If
you fail to load the current database, and
then save your settings, the current data-
base will be overwritten with a file that
contains only these changes.
Even if you overwrite the database by
mistake, there is no need to panic: SCPM
saves the last three versions of the
database in the
/var/lib/scpm/scdb/
directory. The current database is called
scdb.db
, the backup copies have a
few random characters added to their
names.
It is easy to create your own backup of
a profile you have created. You will need
more than just the database file,
scdb.db
.
To store the configuration files at the
same time, you will also need to copy the
/var/lib/scpm/profiles/
directory to a safe
location.
Command Line Set Up
Although YaST2 makes light work of
configuring SCPM, continually launch-
ing YaST to change a profile may start to
get on your nerves. The command line
provides an alternative. Make sure you
have
root
privileges – after all, you will
be modifying the system configuration –
and use a few simple commands to
speed up this task. Table 1 provides an
overview of the most important com-
mands. For example,
scpm switch ISDN
enables a profile called
ISDN
.
Changes can only be applied to the
current profile, no matter whether you
use YaST2 or the command line to effect
them. To do so, first change your settings
in the usual way. When you have every-
thing working to your liking, simply call
scpm save
to save
the changes. SCPM
will then display
the changes one by
one, and prompt
you to confirm that
they were deliber-
ate before saving
them to the profile.
If you need to
change configura-
tion files that SCPM
is ignoring due to
your resource set-
tings, you can
perform manual
changes in inter-
active database
■
Figure 3: Unlimited configuration options for profiles.
www.linux-magazine.com
May 2004
31
Plik z chomika:
SOLARIX33
Inne pliki z tego folderu:
2010.10_Popular Demand-Sql Selects in Javascript with Publicsql.pdf
(728 KB)
2010.10_New Start-What's Coming in Html 5.pdf
(645 KB)
2010.10_Hook, Line, and Sinker-Testing Web Applications with Google's Skipfish.pdf
(756 KB)
2010.10_Easy Street-Simplifying Site Management.pdf
(601 KB)
2010.09_Return of the Lost Sibling-Failure Tolerance with Xen 4 and Remus.pdf
(634 KB)
Inne foldery tego chomika:
Ask Klaus
Beginners
Comment
Community
Community Notebook
Zgłoś jeśli
naruszono regulamin