Section 33.6. System Maintenance (Topic 2.211)


33.6. System Maintenance (Topic 2.211)

33.6.1. Review Questions

  1. You want a central logging server to accept log entries from several remote systems. What option in the syslogd or sysklogd file would you enter to enable the logging daemon to accept remote log entries?

  2. What is the format of an entry in the /etc/syslogd file?

  3. You wish to configure the /etc/hosts file so that remote logging always works, even if the DNS server fails. Which should be specified first when creating a host entry: the host's IP address or the host's name?

  4. What is the syntax of a log entry in the /var/log/messages file?

  5. What command builds a Debian package?

  6. What is the command used to build an RPM package?

33.6.2. Answers

  1. The option is -r.

  2. facility/priority.

  3. The host's IP address is entered first.

  4. The date, the time, the hostname, the daemon that prompted the log entry, and the message from the daemon.

  5. The -b option tells dpkg to build a package. This option specifies the name of the directory that contains the files necessary for building the package. Finally, you specify the name of the package that you are building:

     dpkg -b file_system_tree_directory name_of_package.deb 

  6. Use the -ba option to tell the RPM facility to build binary and source packages. The command also specifies the spec filename, not the name of the built package.

     rpm -ba spec_file_name-1.0.spec 

33.6.3. Exercises

  1. Go onto the Internet and read about the construction of an RPM spec file. When it comes to understanding a spec file, be able to identify the purpose of the following:


    Header

    Describes the contents of the RPM, including the name of the RPM, the version, the release date, and the URL of the source file.


    Preparation

    Gathers all of the files that will be used during the installation process.


    Build

    Used to build the software once it has been gathered together. This section does not install files. An optional section, used mostly when dealing with source RPMs.


    Installation

    Contains the commands necessary for actually installing the application or service.


    System cleaning

    Macros that ensure that the spec file is built in a clean environment.


    Pre- and postinstallation scripts

    Where you can place instructions for scripts that run before and after the RPM is installed.


    Changelog

    Describes the changes that have been made to an RPM.

    You can then build the RPM using the following command:

     rpm -ba foobar-1.0.spec 

  2. Study the components of the files necessary for creating a Debian package. Use the dpkg command to view the contents of a Debian package. For example, to read the file named xpdf, you might issue the following command:

     dpkg -c xpdf-reader_3.00-11ubuntu3.7_i386.deb 

    You could, of course pipe the output into the less command, if the file listing goes off the screen.

  3. Study the /var/log/messages file and make sure you understand each field of the log entry. Make sure that you can tell the difference between locally generated log files and those that are generated from remote systems.

  4. Use the tail command to view the last 10 lines of the /var/log/messages file. Notice that many log facilities send messages to this file. You can create custom logs that contain less information. Open the /etc/syslog.conf file using a text editor and create entries that send critical (crit) messages for the following facilities:

    • Daemon

    • Mail

    • News

    Make sure you restart syslogd after you have made your changes.

  5. Edit the /etc/syslog.conf file and configure syslogd to send logs to a remote system. You will have to configure the remote system to accept log files. This is accomplished by using the -r option in the syslogd configuration file (e.g., /etc/rc.d/init.d/syslogd in Red Hat/Fedora systems and /etc/init.d/sysklogd in Debian-based systems). Consider creating custom logs that will be sent to a remote system.

  6. Create a preliminary backup storage plan. When doing so, consider the following issues:

    • Backup method (differential versus incremental).

    • Medium to use (e.g., tape, CD/DVD).

    • Proper storage of backups. Consider ways to store an entire set of tapes remotely, as well as to verify all backups to make sure data has not been corrupted during backup.

    Study the difference between differential and incremental backups. For what situation or situations is each method most suited? What are the drawbacks for each method?

  7. Sometimes, it is advisable to edit the /etc/hosts file and create entries for essential systems. For example, if you have a central logging server, enter the hostname and IP address for that server. This way, your system will be able to log to the central server even if DNS goes down.



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net