Basically, two front-ends are available for configuring SCPM. The scpm package contains a command-line front-end. The YaST Profile Manager can be used for the graphical configuration. Because both front-ends have the same functionality and an understanding of the command-line front-end greatly enhances understanding of the YaST module, the following instructions mainly focus on the command-line front-end. Special features of the YaST module are addressed where relevant.
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. All resource groups can also be configured with the YaST profile manager.
A profile named default already exists after SCPM has been activated. Get a list of all available profiles with scpm list. This only 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 possibilities 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.
Profiles can be renamed or deleted 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 YaST module only offers anbutton. Pressing it opens a dialog in which to select whether an existing profile should be copied or the current system configuration should be saved. Use for renaming.
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 the switch command 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 instance, 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:
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 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 (root). The access to these files must be blocked for all other users. Enter the commands chmod 700 <filename> and chown root:root <filename> to give root exclusive permissions to the files.
Query all additional settings entered with set with get. The command scpm get poststart, for instance, 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.