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
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
NAME or scpm
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
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
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
default work. The command scpm
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
marking it as active. Running scpm
reload then saves changes to the profile
Profiles can be renamed or deleted with the commands scpm
rename x y and scpm
z. For example, to rename
project, enter scpm
project. To delete
delete project. The active profile
cannot be deleted.
The command scpm
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
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 the switch command with the
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
list. For the active profile, set
it with scpm
set description "text".
Provide the name of the profile for inactive profiles, for example,
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:
prior to stopping services when leaving the profile
after stopping services when leaving the profile
prior to starting services when activating the profile
after starting services when activating the profiles
Insert these actions with the command set by entering
set prestop filename,
set poststop filename,
set prestart filename, or
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
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
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