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. 使用javaDate类代数据仓库维度表

    使用javaDate类代数据仓库维度表 Date类别: ,返回一个相对日期的毫秒数.精确到毫秒.但不支持日期的国际化和分时区显示. Date 类从Java 开发包(JDK)1.0 就開始进化,当时它仅 ...

  2. Python数据结构之注意事项

    1.列表 列表是Python中使用最频繁的数据结构,列表提供很多函数操作,比如下标存取,分片,index,append,remove等等. 例如:  list=[1,2,'hello','python ...

  3. 【翻译自mos文章】11gR2中的asm后台进程

    11gR2中的asm后台进程 參考原文: ASM Background Processes in 11.2 (Doc ID 1641678.1) 适用于: Oracle Database - Ente ...

  4. JDBC数据库编程常用接口(转)

    JDBC的全称是Java DataBase Connectivity,是一套面向对象的应用程序接口(API),制定了统一的访问各种关系数据库的标准接口,为各个数据库厂商提供了标准接口的实现.这东西能够 ...

  5. openstack之nova-api服务流程分析

    nova-api公布api服务没实用到一个些框架,基本都是从头写的.在不了解它时,以为它很复杂,难以掌握.花了两三天的时间把它分析一遍后,发现它本身的结构比較简单,主要难点在于对它所使用的一些类库不了 ...

  6. 大约 Apple Metal API 一些想法

    看后 Metal 的开发文档后,除了官方所宣称的一些长处外(比方说更easy理解和使用的 API.更直接和精细的硬件控制,降低 GPU 使用过程中的 CPU 额外开销等等),从我有限的 GLES 开发 ...

  7. 有关信息ACM/ICPC竞争环境GCC/G++叠插件研究记录的扩展

    0.起因 有时.DFS总是比BFS受人喜爱--毕竟DFS简单粗暴,更,而有些东西BFS不要启动,DFS它似乎是一个可行的选择-- 但是有一个问题,DFS默认直接写入到系统堆栈.系统堆栈和足够浅,此时O ...

  8. maven 打包 时出现非法字符: /65279错误

    maven 打包 时出现非法字符: /65279错误 碰到的一个问题: 使用下面的命令给工程打包时, maven mvn clean package -Ptest01 -Dmaven.test.ski ...

  9. [Oracle] 接线表

    于OLTP制,嵌套连接占70%左右,哈希联接占20%,合并排序连接帐户10%. 嵌套连接 算法:嵌套连接从两个表分选出小表为驱动表,大表为被驱动表.先訪问驱动表(仅仅訪问1次).然后依据驱动表返回的行 ...

  10. spoj Balanced Numbers(数位dp)

    一个数字是Balanced Numbers,当且仅当组成这个数字的数,奇数出现偶数次,偶数出现奇数次 一下子就相到了三进制状压,数组开小了,一直wa,都不报re, 使用记忆化搜索,dp[i][s] 表 ...