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. Android开源client之LookAround学习(一)Application & 网络框架

    之前看过开源clientLookAround(下载地址:http://download.csdn.net/detail/hualulove/7306807),链接:http://blog.csdn.n ...

  2. HDU 3830 Checkers

    意甲冠军: 有三件  所有其他棋子可以跳  不能分开的两个跳跃  当被问及状态u为了国家v最低短跳转 思路: 对于一个状态三个棋子的位置能够设为 x y z  (小到大) 仅仅有当y-x=z-y的时候 ...

  3. Knockout应用开发指南 第三章:绑定语法(2)

    原文:Knockout应用开发指南 第三章:绑定语法(2) 7   click 绑定 目的 click绑定在DOM元素上添加事件句柄以便元素被点击的时候执行定义的JavaScript 函数.大部分是用 ...

  4. win7系统u盘安装过程

    1.准备好带有启动项的U盘,并把镜像解压到里面去 2.插上u盘,开机长按del键进入bois设置界面 在boot页面 1.boot device priority->1st boot devic ...

  5. cocos2d-html5 碰撞检測的几种方法

    游戏中的碰撞还是比較多的,比方角色与角色的碰撞,角色与墙壁的碰撞,角色与怪物的碰撞等,都须要 进行碰撞的检測,来触发一定的事件 近期在尝试制作一个小游戏的时候须要用到碰撞检測,然后就查了下资料,并在论 ...

  6. dede 首页或列表页调用文章内容页body内容

    在使用dede过程,有的朋友会调调出文章的列表的内容出来,怎么调呢?当然是用dede的传参的数据查询语句了,方法如下: {dede:arclist flag=h typeid=2 row=1 titl ...

  7. Linux查看进程线程个数

    1.根据进程号进行查询: # pstree -p 进程号 # top -Hp 进程号 2.根据进程名字进行查询: # pstree -p `ps -e | grep server | awk '{pr ...

  8. 经常使用的正則表達式归纳—JavaScript正則表達式

    来源:http://www.ido321.com/856.html 1.正则优先级 首先看一下正則表達式的优先级,下表从最高优先级到最低优先级列出各种正則表達式操作符的优先权顺序: 2.经常使用的正則 ...

  9. iOS国际化和genstrings所有子文件夹本地化字符串

    iOS国际化和genstrings所有子文件夹本地化字符串 在最近的一个繁忙的对外工程.每天加班.没有时间更新博客.简单谈一下知识的国际化. 首先,我们使用串.必须NSLocalizedString( ...

  10. 对于Hadoop的MapReduce编程makefile

    根据近期需要hadoop的MapReduce程序集成到一个大的应用C/C++书面框架.在需求make当自己主动MapReduce编译和打包的应用. 在这里,一个简单的WordCount1一个例子详细的 ...