Lab 4 System Services

Goal: Develop skills using system administration tools and setting up and administering CUPS.

Estimated Duration: 30

Sequence 1: Using cron

Scenario: You want to know some information about the status of the system every ten minutes today to help investigate some performance issues you have been having. You suspect it might be memory or I/O related and want to keep an eye on those resources.

Deliverable: A cron job that runs every ten minutes today between the hours of 0800 (8:00 AM) and 1700 (5:00 PM).

Instructions:

1. Using crontab -e create a cron job that executes /usr/bin/free and /bin/ps every 10 minutes between 0800 (8:00 am) and 1750 (5:50 pm).

a. As root, use the command crontab -e to edit your cron file. (If you are not comfortable with vi, export an EDITOR environment variable to set another editor.)

b. Enter the following line in your crontab file:

*/10 8-17 * * * /usr/bin/free; /bin/ps

2. How could you send the output from these cron jobs to another e-mail address?

You can set the MAILTO=user variable or use command | mail -s test user

3. Use mail, or mutt as root to check for email from the cron job you have scheduled.

4. Be sure to delete your cron job when you have received several emails from it.

Sequence 2: Logging to a centralized log host

Scenario: Your boss thinks it is a great idea to have one central logging host.

Work together with your neighbor. Set up one machine as the log server and the other as a log client

Instructions:

1. First, on the log server set up syslogd to accept remote messages.

a. Edit /etc/sysconfig/syslog:

SYSLOGD_OPTIONS=“-r -m 0”

b. Restart syslogd:

# service syslog restart

2. On the log client set up syslogd to send messages from the user facility to the log server.

a. Append in /etc/syslog.conf the following line:

user.* @192.168.0.X

b. Restart syslogd.

# service syslog restart

3. Test the new setup by using logger to generate a syslog message. Does the message appear in your neighbor's /var/log/messages?

# logger -i -t yourname "This is a test"

Sequence 3: Setting up a printer and administering a printer with CUPS.

Instructions:

1. Use system-config-printer to create a local queue named testprinter using the generic Postscript printer driver

a. As root run system-config-printer or select System->Administration->Printing in the graphical interface.

b. Click New Printer

c. Enter the text: testprinter in the Printer Name field and click Forward.

d. Select Serial Port #1 from the Select Connection. This describes a locally-connected printer. Click Forward.

e. Select Generic from the Makes list and click Forward.

f. Scroll down to and select Postscript Printer from the Models list and click Forward.

g. Click Apply.

h. After a short pause, you should see your new printer in the Local Printers section of the main interface.

2. Make testprinter your default printer and print a test page.

a. Select testprinter from system-config-printer's Local Printers list to display its settings interface. Note that there are many new configuration options available once the printer has been created.

b. Click Make Default Printer.

c. Click Print Test Page. Click OK in the confirmation dialog.

d. If you are using Gnome, a printer icon should appear in in the corner of your screen. Click this icon and you will see your test page waiting to print. Since your printer does not actually exist, this will never happen, so you may wish to remove the print job by right-clicking on it and selecting Cancel Documents.

3. Use the lp command to print the file /root/install.log from the command line. Since you do not have a real printer attached, this job will be queued forever. Verify the status of the print queue with lpstat and then remove the print job with cancel.

a. # lp /root/install.log

b. # lpstat

(Note: you should see at least one print job active for root with Job number 1. If your test page is still in the queue, you should see it as well)

c. Type the command: cancel 1 to remove the job.

d. Type the command: lpstat The job should now be removed.

RH133读书 笔记(4) - Lab 4 System Services的更多相关文章

  1. RH133读书笔记(11)-Lab 11 System Rescue and Troubleshooting

    Lab 11 System Rescue and Troubleshooting Goal: To build skills in system rescue procedures. Estimate ...

  2. RH253读书笔记(2)-Lab 2 System Resource Access Controls

    Lab 2 System Resource Access Controls Goal: To become familiar with system resource access controls. ...

  3. RH253读书笔记(1)-Lab 1 System Monitoring

    Lab 1 System Monitoring Goal: To build skills to better assess system resources, performance and sec ...

  4. RH133读书笔记(1)-Lab 1 Managing Startup

    Lab 1 Managing Startup Goal: To familiarize yourself with the startup process System Setup: A system ...

  5. RH133读书笔记(2)-Lab 2 Working with packages

    Lab 2 Working with packages Goal: To gain working experience with package management System Setup: A ...

  6. RH133读书 笔记(5) - Lab 5 User and Group Administration

    Lab 5 User and Group Administration Goal: To build skills for user and group administration. Estimat ...

  7. RH133读书 笔记(3) - Lab 3 Configuring the kernel

    Lab 3 Configuring the kernel Goal: Develop skills tuning the /proc filesystem. Gain some experience ...

  8. RH133读书笔记(6) - Lab 6 Adding New Filesystems to the Filesystem Tree

    Lab 6 Adding New Filesystems to the Filesystem Tree Goal: Develop skills and knowlege related to par ...

  9. RH133读书笔记(9)-Lab 9 Installation and System-Initialization

    Lab 9 Installation and System-Initialization Goal: Successfully install Red Hat Enterprise Linux. Sy ...

随机推荐

  1. 使用yiic安装开发web应用和解决yiic不是内部命令

    使用yii创建应用程序,推荐博客:http://www.cnblogs.com/waitingbar/archive/2013/02/28/2937308.html 把php.exe加入为系统环境变量 ...

  2. mysql 编译安装提示“checking for termcap functions library... configure: error: No curses/termcap library found”

    原因: 缺少ncurses安装包 解决办法: 下载安装相应软件包 一.如果你的系统是RedHat系列: yum list|grep ncurses yum -y install ncurses-dev ...

  3. Python的控制结构(转)

    首先我的工作第一语言是c/c++(面向对象子集).选择学习python一方面是因为看很多人都说python开发效率高,所以想验证一下:另一方面,Eric S. Raymond在文章:如何成为一名黑客 ...

  4. 字符串匹配的KMP算法(转)

    字符串匹配是计算机的基本任务之一. 举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想知道,里面是否包含另一个字符串"ABCDABD" ...

  5. 日版 Galaxy Note sc05d 涮机

    问题描写叙述:手机已坏.进不了系统 以下提供线涮刷机教程: 1.首先拔掉你的sd卡和sim卡.双清你的手机.可能有些版本号的机油没有双清模式,那就进到设置里边恢复出厂设置,然后关掉你的手机再开机.等到 ...

  6. Android之查看外部依赖jar的源代码_android private libralies does not allow modifications to source

    在Eclipse中开发android的应用程序时,有时想查看函数的内部实现.可是当在函数上点击ctrl和鼠标左键的时候. 往往出现例如以下提示: Class File Editor Source no ...

  7. 蚁群算法 matlab程序(已执行)

    下面是解放军信息project大学一个老师编的matlab程序,请尊重原作者劳动,引用时请注明出处. 我经过改动添加了凝视,已经执行过,无误, function [R_best,L_best,L_av ...

  8. 第三章 AOP 基于@AspectJ的AOP

    在前面,我们分别使用Pointcut.Advice.Advisor接口来描述切点.增强.切面.而现在我们使用@AdpectJ注解来描述. 在下面的例子中,我们是使用Spring自动扫描和管理Bean. ...

  9. Python学习入门基础教程(learning Python)--3.3.3 Python逻辑关系表达式

    在if分支判断语句里的条件判断语句不一定就是一个表达式,可以是多个(布尔)表达式的组合关系运算,这里如何使用更多的关系表达式构建出一个比较复杂的条件判断呢?这里需要再了解一下逻辑运算的基础知识.逻辑关 ...

  10. Atitit. .net c# web 跟clientwinform 的ui控件结构比較

    Atitit. .net c# web 跟clientwinform 的ui控件结构比較 .net   4.5 webform Winform 命名空间 System.Web.UI.WebContro ...