Chapter 1. Red Hat Satellite Information
1.1. Command Line Configuration Management Tools
Note
/var/lib/rhncfg/backups/ directory on the affected system. The backup retains its filename but has a .rhn-cfg-backup extension appended.
1.1.1. Red Hat Network Actions Control
rhn-actions-control) application is used to enable and disable configuration management of a system. Client systems cannot be managed in this fashion by default. This tool allows System Administrators to enable or disable specific modes of allowable actions such as: deploying a configuration file onto the system, uploading a file from the system, using diff to find out what is currently managed on a system and what is available, or allowing running arbitrary remote commands. These various modes are enabled/disabled by placing/removing files and directories in the /etc/sysconfig/rhn/allowed-actions/ directory. Due to the default permissions on the /etc/sysconfig/rhn/ directory, Red Hat Network Actions Control have to be run by someone with root access.
1.1.1.1. General command line options
man page available, as there are for most command line tools. Simply decide what Red Hat Network scheduled actions should be enabled for use by system administrators. These options enable the various scheduled action modes:
Table 1.1. rhn-actions-control options
| Option | Description |
|---|---|
| --enable-deploy | Allow rhncfg-client to deploy files. |
| --enable-diff | Allow rhncfg-client to diff files. |
| --enable-upload | Allow rhncfg-client to upload files. |
| --enable-mtime-upload | Allow rhncfg-client to upload mtime. |
| --enable-all | Allow rhncfg-client to do everything. |
| --enable-run | Enable script.run |
| --disable-deploy | Disable deployment. |
| --disable-diff | Disable diff |
| --disable-upload | Disable upload |
| --disable-mtime-upload | Disable mtime upload |
| --disable-all | Disable all options |
| --disable-run | Disable script.run |
| --report | Report whether the modes are enabled or disabled |
| -f, --force | Force the operation without asking first |
| -h, --help | show help message and exit |
rhn-actions-control --enable-all is a common option.
1.1.2. Red Hat Network Configuration Client
rhncfg-client) is installed and run from an individual client system. From there you may use it to gain knowledge about how Red Hat Network deploys configuration files to the client.
1.1.2.1. Listing Config Files
rhncfg-client listConfig Channel File config-channel-17 /etc/example-config.txt config-channel-17 /var/spool/aalib.rpm config-channel-14 /etc/rhn/rhn.conf
rhncfg-manager list config-channel-14Files in config channel 'config-channel-14' /etc/example-config.txt /etc/rhn/rhn.conf
/etc/example-config.txt went. The rank of the /etc/example-config.txt file in config-channel-17 was higher than that of the same file in config-channel-14. As a result, the version of the configuration file in config-channel-14 is not deployed for this system, although the file still resides in the channel. The rhncfg-client command does not list the file because it will not be deployed on this system.
1.1.2.2. Getting a Config File
rhncfg-client get /etc/example-config.txtDeploying /etc/example-config.txt
less or another pager. Note that the file is selected as the most relevant based upon the rank of the config channel containing it. This is accomplished within the Configuration tab of the System Details page.
1.1.2.3. Viewing Config Channels
rhncfg-client channelsConfig channels: Label Name ----- ---- config-channel-17 config chan 2 config-channel-14 config chan 1
rhncfg-client get:
Table 1.2. rhncfg-client get options
| Option | Description |
|---|---|
| --topdir=TOPDIR | Make all file operations relative to this string. |
| --exclude=EXCLUDE | Excludes a file from being deployed with 'get'/ May be used multiple times. |
| -h, --help | Show help message and exit |
1.1.2.4. Differentiating between Config Files
rhncfg-client diff[root@testsatellite root]# rhncfg-client diff --- /etc/test +++ /etc/test 2013-08-28 00:14:49.405152824 +1000 @@ -1 +1,2 @@ This is the first line +This is the second line added
--topdir option to compare config files in Red Hat Network with those located in an arbitrary (and unused) location on the client system, like so:
[root@ root]# rhncfg-client diff --topdir /home/test/blah/ /usr/bin/diff: /home/test/blah/etc/example-config.txt: No such file or directory /usr/bin/diff: /home/test/blah/var/spool/aalib.rpm: No such file or directory
1.1.2.5. Verifying Config Files
rhncfg-client verifymodified /etc/example-config.txt /var/spool/aalib.rpm
example-config.txt is locally modified, while aalib.rpm is not.
rhncfg-client verify:
Table 1.3. rhncfg-client verify options
| Option | Description |
|---|---|
| -v, --verbose | Increase the amount of output detail. Displays differences in the mode, owner, and group permissions for the specified config file. |
| -o, --only | Only show files that differ. |
| -h, --help | Show help message and exit |
1.1.3. Red Hat Network Configuration Manager
rhncfg-manager) is designed to maintain Red Hat Network's central repository of config files and channels, not those located on client systems. This tool offers a command line alternative to the configuration management features within the Red Hat Network website, as well as the ability to script some or all of the related maintenance.
/etc/sysconfig/rhn/rhncfg-manager.conf or in the [rhncfg-manager] section of ~/.rhncfgrc.
~/.rhncfgrc file. The session file is cached in ~/.rhncfg-manager-session to prevent logging in for every command.
server.session_lifetime option and new value to the /etc/rhn/rhn.conf file on the server running the manager, like so:
server.session_lifetime = 120
rhncfg-manager mode --help
rhncfg-manager diff-revisions --helprhncfg-manager add options”.
1.1.3.1. Creating a Config Channel
rhncfg-manager create-channel channel-labelRed Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created
1.1.3.2. Adding Files to a Config Channel
rhncfg-manager add --channel=channel-label /path/to/file--dest-file option in the command, like:
rhncfg-manager add --channel=channel-label --dest-file=/new/path/to/file.txt/path/to/filePushing to channel example-channel Local file >/path/to/file -> remote file /new/path/to/file.txt
rhncfg-manager add:
Table 1.4. rhncfg-manager add options
| Option | Description |
|---|---|
| -c CHANNEL --channel=CHANNEL | Upload files in this config channel |
| -d DEST_FILE --dest-file=DEST_FILE | Upload the file as this path |
| --delim-start=DELIM_START | Start delimiter for variable interpolation |
| --delim-end=DELIM_END | End delimiter for variable interpolation |
| -i, --ignore-missing | Ignore missing local files |
| --selinux-context=SELINUX_CONTEXT | Overwrite the SELinux context |
| -h, --help | show help message and exit |
Note
/etc/rhn/rhn.conf file:
web.maximum_config_file_size=128
/etc/rhn/rhn.conf file:
maximum_config_file_size=128
1.1.3.3. Differentiating between Latest Config Files
rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file--- /tmp/dest_path/example-config.txt config_channel: example-channel revision: 1 +++ /home/test/blah/hello_world.txt 2003-12-14 19:08:59.000000000 -0500 @@ -1 +1 @@ -foo +hello, world
rhncfg-manager diff:
Table 1.5. rhncfg-manager diff options
| Option | Description |
|---|---|
| -c CHANNEL, --channel=CHANNEL | Get file(s) from this config channel |
| -r REVISION, --revision=REVISION | Use this revision |
| -d DEST_FILE, --dest-file=DEST_FILE | Upload the file as this path |
| -t TOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| -h, --help | Show help message and exit |
1.1.3.4. Differentiating between Various Versions
-r flag to indicate which revision of the file should be compared and the -n flag to identify the two channels to be checked. See Section 1.1.3.11, “Determining the Number of File Revisions” for related instructions. Specify only one file name here, since you are comparing the file against another version of itself. For example:
rhncfg-manager diff-revisions -n=channel-label1 -r=1 -n=channel-label2 -r=1 /path/to/file.txt--- /tmp/dest_path/example-config.txt 2004-01-13 14:36:41 \ config channel: example-channel2 revision: 1 --- /tmp/dest_path/example-config.txt 2004-01-13 14:42:42 \ config channel: example-channel3 revision: 1 @@ -1 +1,20 @@ -foo +blah +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.0.6 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +iD8DBQA9ZY6vse4XmfJPGwgRAsHcAJ9ud9dabUcdscdcqB8AZP7e0Fua0NmKsdhQCeOWHX +VsDTfen2NWdwwPaTM+S+Cow= +=Ltp2 +-----END PGP SIGNATURE-----
rhncfg-manager diff-revisions:
Table 1.6. rhncfg-manager diff-revisions options
| Option | Description |
|---|---|
| -c CHANNEL, --channel=CHANNEL | Use this config channel |
| -r REVISION, --revision=REVISION | Use this revision |
| -h, --help | Show help message and exit |
1.1.3.5. Downloading All Files in a Channel
rhncfg-manager download-channel channel-label --topdir . Copying /tmp/dest_path/example-config.txt -> \ blah2/tmp/dest_path/example-config.txt
rhncfg-manager download-channel:
Table 1.7. rhncfg-manager download-channel options
| Option | Description |
|---|---|
| -t TOPDIR, --topdir=TOPDIR | Directory all the file paths are relative to. This option must be set. |
| -h, --help | Show help message and exit |
1.1.3.6. Getting the Contents of a File
rhncfg-manager get --channel=channel-label \ /tmp/dest_path/example-config.txt 1.1.3.7. Listing All Files in a Channel
rhncfg-manager list channel-labelFiles in config channel `example-channel3': /tmp/dest_path/example-config.txt
rhncfg-manager get:
Table 1.8. rhncfg-manager get options
| Option | Description |
|---|---|
| -c CHANNEL, --channel=CHANNEL | Get file(s) from this config channel |
| -t TOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| -r REVISION, --revision=REVISION | Get this file revision |
| -h, --help | Show help message and exit |
1.1.3.8. Listing All Config Channels
rhncfg-manager list-channels Available config channels: example-channel example-channel2 example-channel3 config-channel-14 config-channel-17
local_override or server_import channels.
1.1.3.9. Removing a File from a Channel
rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txtRed Hat Network username: rhn-user Password: Removing from config channel example-channel3 /tmp/dest_path/example-config.txt removed
rhncfg-manager remove:
Table 1.9. rhncfg-manager remove options
| Option | Description |
|---|---|
| -c CHANNEL, --channel=CHANNEL | Remove files from this config channel |
| -t TOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| -h, --help | Show help message and exit |
1.1.3.10. Deleting a Config Channel
rhncfg-manager remove-channel channel-label Removing config channel example-channel Config channel example-channel removed
1.1.3.11. Determining the Number of File Revisions
rhncfg-manager revisions channel-label /tmp/dest_path/example-config.txt Analyzing files in config channel example-channel \ /tmp/dest_path/example-config.txt: 1
1.1.3.12. Updating a File in a Channel
rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/filePushing to channel example-channel: Local file example-channel/tmp/dest_path/example-config.txt -> \ remote file /tmp/dest_path/example-config.txt
rhncfg-manager update:
Table 1.10. rhncfg-manager update options
| Option | Description |
|---|---|
| -c CHANNEL, --channel=CHANNEL | Upload files in this config channel |
| -d DEST_FILE, --dest-file=DEST_FILE | Upload the file as this path |
| -t TOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| --delim-start=DELIM_START | Start delimiter for variable interpolation |
| --delim-end=DELIM_END | End delimiter for variable interpolation |
| -h, --help | Show help message and exit |
1.1.3.13. Uploading Multiple Files at Once
rhncfg-manager upload-channel --topdir=topdir channel-labelUsing config channel example-channel4 Uploading /tmp/ola_world.txt from blah4/tmp/ola_world.txt
rhncfg-manager upload-channel:
Table 1.11. rhncfg-manager upload-channel options
| Option | Description |
|---|---|
| -t TOPDIR, --topdir=TOPDIR | Directory all the file paths are relative to |
| -c CHANNEL, --channel=CHANNEL | List of channels the config info will be uploaded into. Channels delimited by ','. Example: --channel=foo,bar,baz |
| -h, --help | Show help message and exit |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.