Abstract
With the help of SCPM (system configuration profile management), adapt the configuration of your computer to different operating environments or hardware configurations. SCPM manages a set of system profiles for the different scenarios. It enables easy switching between system profiles, eliminating the need for manually reconfiguring the system.
Some situations require a modified system configuration. This would mostly be the case for mobile computers that are operated in varying locations. If a desktop system should be operated temporarily using other hardware components than usual, SCPM comes in handy. Restoring the original system configuration should be easy and the modification of the system configuration can be reproduced. With SCPM, any part of the system configuration can be kept in a customized profile.
The main field of application of SCPM is network configuration on laptops. Different network configurations often require different settings of other services, such as e-mail or proxies. Then other elements follow, like different printers at home and at the office, a customized X server configuration for the multimedia projector at conferences, special power-saving settings for the road, or a different time zone at an overseas subsidiary.
The following are some terms used in SCPM documentation and in the YaST module.
The complete configuration of the computer. It covers all fundamental settings, such as the use of hard disk partitions, network settings, time zone selection, and keyboard mappings.
A state that has been preserved and can be restored at any time.
The profile last selected. This does not mean that the current system configuration corresponds exactly to this profile, because the configuration can be modified at any time.
An element that contributes to the system configuration. This can be a file or a softlink including metadata (like the user), permissions, or access time. This can also be a system service that runs in this profile, but is deactivated in another one.
Every resource belongs to a certain resource group. These groups contain all resources that logically belong together—most groups would contain both a service and its configuration files. It is very easy to assemble resources managed by SCPM because this does not require any knowledge of the configuration files of the desired service. SCPM ships with a selection of preconfigured resource groups that should be sufficient for most scenarios.
The following sections introduce SCPM configuration by means of a real life example: a mobile computer that is run in several different networks. The major challenges faced in this scenario are:
Varying network environments, like wireless LAN at home and an ethernet at work
Different printer configuration at home and at work
To get SCPM up and running and have it manage your changing system configuration, proceed as follows:
Add the Profile Chooser applet to your panel and configure it to allow user switching as described in the section called “Configuring the Profile Chooser Panel Applet”.
Configure SCPM using the YaST Profile Manager module as described in the section called “Configuring Basic SCPM Settings”.
Create a profile for each of the different setups using SUMF (SCPM Unified Management Front-End) as described in the section called “Creating a New Profile”.
Switch to the profile appropriate for your current situation as described in the section called “Switching Profiles”.
If you prefer to control SCPM with its command line interface, refer to the section called “Configuring SCPM Using the Command Line” for details.
The following sections introduce the graphical tools used for controlling your profile settings.
Before you can use Profile Chooser to control your system configuration, configure it to be started automatically on login:
In GNOME, right-click the panel and select Profile Chooser from the list of available applets.
In KDE, select
-> -> to add Profile Chooser to your panel.Configure the basic behavior of SCPM through YaST.
Start YaST from the main menu and select the YaST Profile Manager.
In
, click and select .Determine how verbose SCPM should be by selecting any or both of
and .Determine the appropriate switch mode for your setup:
Should SCPM list any changed resource when switching to another profile and save these changes to the active profile? Select
or .Should SCPM drop any changed resource configuration when switching? Select
.Set the boot mode and determine whether changes to the current profile should be saved or discarded with profile switching triggered at boot time.
Make sure that all resource groups needed are covered by the active selection, displayed in the the section called “Configuring Resource Groups”.
section. If you need additional resource groups, adjust the resources with . For details, refer toFor the example scenario, you do not need to configure additional resources, because printer and network resources are included by default.
To allow users other than root
to manage profiles, proceed
as follows:
Start YaST from the main menu and select the YaST Profile Manager.
Click
.Click
to add any user who should be able to manage profiles.For each user, specify whether to grant switch permissions only or whether this user should be allowed to switch, modify, and create profiles.
Click
to apply your settings and close YaST.After you have enabled SCPM, you have a profile named
default
that contains your current system configuration.
Create another profile that matches the requirements of the other setup.
To add a new profile based on the current system configuration, proceed as follows:
Right-click the Profile Chooser and select
.Select
-> .Enter the name of the new profile and click
.Determine whether the new profile should be the active profile.
If you selected
, SCPM switches to the new profile immediately after it has been created.For this example, do the following:
In your home setup, enable SCPM.
Rename the default
profile to a more descriptive
name by starting SUMF and selecting -> and entering the new name.
In your setup at work, start SUMF and create the profile for your system environment at work.
Once you have all desired profiles, you are ready to switch to them whenever a different system setup is required. Switching profiles is described in the section called “Switching Profiles”.
There are two ways to switch profiles. You can either select a new profile at boot or switch profiles in the running system.
To select a profile at boot, press F3 in the boot screen to access the list of profiles available and use the arrow keys to select the appropriate profile and hit Enter. The system boots into the configuration selected.
To switch profiles in a running system, proceed as follows:
Make sure that you are allowed to switch profiles as a non-root
user. If you are
not allowed to do so, refer to the section called “Configuring Basic SCPM Settings”.
Left-click the Profile Chooser panel applet.
Select the desired profile in the menu that opens using the arrow keys and hit Enter. SCPM runs a check for modified resources and prompts you for a confirmation of the switch. If changes have been made to the system configuration before the switch, select whether to keep them or discard them when switching to another profile.
To adjust existing profiles to a changed environment, for example, if you want to change the printer configuration of your home network, proceed as follows:
Switch to the profile to adjust as described in the section called “Switching Profiles”. In this example, you would
choose the home
profile.
Change the resources that need to be adjusted using the appropriate YaST module. In this example, run the YaST printer configuration.
After the configuration changes have been applied and you request a profile switch, SCPM asks whether these changes should be permanently applied to the formerly active profile.
![]() | Forcing a Profile Update |
---|---|
If you want to force an update of the active profile, click the profile in the profile selection menu of the Profile Chooser panel applet. This triggers a reload of your profile and you are asked whether to apply the configuration changes or discard them. |
SCPM comes with a set of predefined resource groups that are included in any profile by default. However, some scenarios require the inclusion of additional resources and resource groups.
To change the resource configuration, proceed as follows:
Start YaST from the main menu and start the YaST Profile Manager module.
In the
dialog, click in the part of the dialog.All resource groups available on your system are listed as shown in Figure 4.3, “Configuring Resource Groups”.
To add or edit a resource group:
Set or edit
and .Enter the appropriate resources (resources, services, or both) and delete those that are not needed. To reset the status of the selected resources—discard any changes made to them and return to the initial configuration values—choose
.Click
to leave the resource configuration.Click
to save your changes to the active profile.This section introduces the command line configuration of SCPM. Learn how to start it, configure it, and work with profiles.
SCPM must be activated before use. Activate SCPM with scpm
enable
. When run for the first time, SCPM is
initialized, which takes a few seconds. Deactivate SCPM with scpm
disable
at any time to prevent the
unintentional switching of profiles. A subsequent reactivation simply
resumes the initialization.
By default, SCPM handles network and printer settings as well as the
X.Org configuration. To manage special services or configuration
files, activate the respective resource groups. To list the predefined
resource groups, use scpm list_groups
.
To see only the groups already activated, use scpm
list_groups -a
. Issue these commands as
root
on the command line.
scpm list_groups -a nis Network Information Service client mail Mail subsystem ntpd Network Time Protocol daemon xf86 X Server settings autofs Automounter service network Basic network settings printer Printer settings
Activate or deactivate a group with scpm activate_group
NAME
or scpm deactivate_group
NAME
. Replace NAME
with the
relevant group name.
A profile named default
already exists after SCPM has
been activated. Get a list of all available profiles with scpm
list
. This one existing profile is also the
active one, which can be verified with scpm
active
. The profile default
is a basic configuration from which the other profiles are derived. For
this reason, all settings that should be identical in all profiles should
be made first. Then store these modifications in the active profile with
scpm reload
. The
default
profile can be copied and renamed as the basis
for new profiles.
There are two ways to add a new profile. If the new profile (named
work
here) should be based on the profile
default
, create it with scpm copy
default work
. The command scpm switch
work
changes into the new profile, which can then be
modified. You may want to modify the system configuration for special
purposes and save the changes to a new profile. The command scpm
add work
creates a new profile by saving the
current system configuration in the profile work
and
marking it as active. Running scpm
reload
then saves changes to the profile
work
.
Rename or delete profiles with the commands scpm
rename x y
and scpm delete
z
. For example, to rename work
to
project
, enter scpm rename work
project
. To delete project
, enter
scpm delete project
. The active profile
cannot be deleted.
The command scpm switch work
switches to another profile (the profile work
, in this
case). Switch to the active profile to include modified settings
of the system configuration in the profile. This corresponds
to the command scpm reload
.
When switching profiles, SCPM first checks which resources of the
active profile have been modified. It then queries whether the modification
of each resource should be added to the active profile or dropped. If you
prefer a separate listing of the resources (as in former versions of SCPM),
use switch
with the -r
parameter:
scpm switch -r work
.
scpm switch -r work Checking for modified resources Checking for Resources to be started/shut down Checking for dependencies Restoring profile default
SCPM then compares the current system configuration with the profile to which to switch. In this phase, SCPM evaluates which system services need to be stopped or restarted due to mutual dependencies or to reflect the changes in configuration. This is like a partial system reboot that concerns only a small part of the system while the rest continues operating without change. It is only at this point that the system services are stopped, all modified resources, such as configuration files, are written, and the system services are restarted.
You can enter a description for every profile that is displayed with
scpm list
. For the active profile, set
it with scpm set description "text"
.
Provide the name of the profile for inactive profiles, for example,
scpm set description "text" work
.
Sometimes it might be desirable to perform additional actions not provided
by SCPM while switching profiles. Attach up to four executables for each
profile. They are invoked at different stages of the switching process.
These stages are referred to as:
Run prior to stopping services when leaving the profile
Run after stopping services when leaving the profile
Run prior to starting services when activating the profile
Run after starting services when activating the profiles
Insert these actions with the command set by entering
scpm set prestop filename
,
scpm set poststop filename
,
scpm set prestart filename
, or
scpm set poststart filename
. The
scripts must be executable and refer to the correct interpreter.
![]() | Integrating a Custom Script |
---|---|
Additional scripts to be executed by SCPM must be made readable and
executable for the superuser ( |
Query all additional settings entered with set with
get. The command scpm get
poststart
, for example, returns the name of the
poststart call or simply nothing if nothing has been attached. Reset such
settings by overwriting with ""
. The command
scpm set prestop ""
removes
the attached prestop program.
All set and get commands can be
applied to an arbitrary profile in the same manner as comments are added.
For example, scpm get prestop filename
work
or scpm get prestop
work
.
This section covers frequent problems encountered with SCPM. Learn how they can arise and how you can solve these issues.
NetworkManager and SCPM share functionality. Both integrate a machine into an existing network, hiding this transaction from the user. NetworkManager works dynamically and adapts to any new environment. SCPM is used to restore defined system setups.
Using NetworkManager and SCPM in parallel does not work properly, because NetworkManager does not provide configurations that can be restored by SCPM. SCPM works exceedingly well for anyone who needs reproducible setups. Any private user constantly switching networks should consider using NetworkManager if network setup is the only component that needs to be adjusted. If you want to use SCPM to manage your system configuration but NetworkManager to manage networking, remove the network resource from SCPM. If you want to use SCPM for network configuration management, disable NetworkManager.
Sometimes SCPM stops working during a switch procedure. This may be caused
by some outside effect, such as a user abort, a power failure, or even an
error in SCPM itself. If this happens, an error message stating SCPM is
locked appears the next time you start SCPM. This is for system safety,
because the data stored in its database may differ from the state of the
system. To resolve this issue, run scpm
recover
. SCPM performs all missing
operations of the previous run. You can also run scpm
recover -b
, which tries to undo all already
performed operations of the previous run. If you are using the YaST
profile manager, get a recover dialog on start-up that offers
to perform the commands described above.