亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? unx38.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<HTML>

<HEAD>

<TITLE>UNIX Unleashed unx38.htm</TITLE>

<LINK REL="ToC" HREF="index.htm">

<LINK REL="Next" HREF="unx39.htm">

<LINK REL="Previous" HREF="unx37.htm"></HEAD>

<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>

<P><A HREF="unx37.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unx39.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P><UL>

<LI>

<A HREF="#I1">38 &#151; UNIX System Accounting</A></LI>

<UL>

<UL>

<UL>

<UL>

<LI>

<A HREF="#I3">By Scott Allen Parker</A></LI></UL></UL>

<LI>

<A HREF="#I4">How Does System Accounting Work?</A></LI>

<UL>

<LI>

<A HREF="#I5">At the Start</A></LI>

<UL>

<LI>

<A HREF="#I6">acctwtmp</A></LI>

<LI>

<A HREF="#I7">turnacct</A></LI>

<LI>

<A HREF="#I8">remove</A></LI></UL>

<LI>

<A HREF="#I9">Login, Run What You Will, and Logout</A></LI>

<LI>

<A HREF="#I10">System Shutdown</A></LI></UL>

<LI>

<A HREF="#I11">Setting Up and Turning On the System Accounting Option</A></LI>

<LI>

<A HREF="#I12">The Accounting System Programs</A></LI>

<UL>

<LI>

<A HREF="#I13">runacct</A></LI>

<LI>

<A HREF="#I14">dodisk</A></LI>

<LI>

<A HREF="#I15">chargefee</A></LI>

<LI>

<A HREF="#I16">monacct</A></LI>

<LI>

<A HREF="#I17">acctcom</A></LI>

<LI>

<A HREF="#I18">Daily Reports</A></LI>

<LI>

<A HREF="#I19">Daily Report</A></LI>

<LI>

<A HREF="#I20">Daily Usage Report</A></LI>

<LI>

<A HREF="#I21">Daily Command Summary Report and Total Command Summary Report</A></LI>

<LI>

<A HREF="#I22">Last Login Report</A></LI></UL>

<LI>

<A HREF="#I23">Summary</A></LI></UL></UL></UL>



<H1 ALIGN="CENTER">

<CENTER><A ID="I1" NAME="I1">

<BR>

<FONT SIZE=5><A ID="I2" NAME="I2"></A><B>38 &#151; UNIX System Accounting</B>

<BR></FONT></A></CENTER></H1>

<H5 ALIGN="CENTER">

<CENTER><A ID="I3" NAME="I3">

<FONT SIZE=3><B>By Scott Allen Parker</B>

<BR></FONT></A></CENTER></H5>

<P>As you have learned by now, UNIX is a very complex operating system with many types of files, utilities, and programs. Your users are logging in and out, storing files, and running programs. One of the problems you may run into is keeping track of usage 

of the system. UNIX system accounting was created to assist you in keeping track of your users and processes. UNIX system accounting can help you troubleshoot and tune your system performance. You can even give a value to the resources on your system. This 

means that you can charge your users money or a fee for storing files and running processes. In this chapter, you will learn:

<BR></P>

<UL>

<LI>What is UNIX system accounting?

<BR>

<BR></LI>

<LI>How do I set up and turn on the system accounting option?

<BR>

<BR></LI>

<LI>How to generate report?

<BR>

<BR></LI></UL>

<H3 ALIGN="CENTER">

<CENTER><A ID="I4" NAME="I4">

<FONT SIZE=4><B>How Does System Accounting Work?</B>

<BR></FONT></A></CENTER></H3>

<P>The moment the UNIX system is up and running, the system accounting is tracking information about the system. Information is tracked until the system shutdown. The information that is tracked is as follows:

<BR></P>

<UL>

<LI>Users logging in and out of the system

<BR>

<BR></LI>

<LI>How much and many resources a user processes has taken

<BR>

<BR></LI>

<LI>How much disk space has been used by the users' files

<BR>

<BR></LI></UL>

<P>Several processes and the UNIX kernel help the system track this usage. Several of these daemons have been covered in previous chapters.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I5" NAME="I5">

<FONT SIZE=3><B>At the Start</B>

<BR></FONT></A></CENTER></H4>

<P>When you boot the UNIX system into multiuser mode, UNIX runs a program called /usr/lib/acct/startup. startup is a shell script that runs other accounting programs and sets flags in the system to make the kernel and other processes to start recording 
information. Some of the accounting programs that are run by the startup shell script are as follows:

<BR></P>

<PRE>

<BR>acctwtmp



<BR>turnacct



<BR>remove</PRE>

<P>These programs are discussed in the following sections.

<BR></P>

<H5 ALIGN="CENTER">

<CENTER><A ID="I6" NAME="I6">

<FONT SIZE=3><B>acctwtmp</B>

<BR></FONT></A></CENTER></H5>

<P>The /usr/lib/acct/acctwtmp program writes a record into the file called /var/adm/wtmp. wtmp is a key file of the accounting system, containing records about users connecting to the system, date changes, reboots, and system startup and shutdowns. 
Specifically, /var/adm/wtmp has information about the following:

<BR></P>

<UL>

<LI>A user's login name

<BR>

<BR></LI>

<LI>The device the user is logging in on

<BR>

<BR></LI>

<LI>The user's process id (PID)

<BR>

<BR></LI>

<LI>How the user is logging in

<BR>

<BR></LI>

<LI>The date and time the login was made

<BR>

<BR></LI></UL>

<P>The record created by acctwtmp is a &quot;boot&quot; record containing the name of the system and the date and time the accounting system was started. You might see this information referred to as reasons in your man pages. In the startup and shutdown 
script, you could see:

<BR></P>

<PRE>/usr/lib/acct/acctwtmp &quot;Accounting System ON&quot; &gt;&gt; /var/adm/wtmp</PRE>

<P>or

<BR></P>

<PRE>/usr/lib/acct/acctwtmp &quot;Accounting System OFF&quot; &gt;&gt; /var/adm/wtmp</PRE>

<P>If you were to list the /var/adm/wtmp file you would find entries for the two examples above. The wording might be slightly different depending upon your Operating System.

<BR></P>

<H5 ALIGN="CENTER">

<CENTER><A ID="I7" NAME="I7">

<FONT SIZE=3><B>turnacct</B>

<BR></FONT></A></CENTER></H5>

<P>The /usr/lib/acct/turnacct program turns on the accounting system. If you look inside the startup shell script, you will see the line containing:

<BR></P>

<PRE>/usr/lib/acct/turnacct on</PRE>

<P>This program will run a special process called accton.

<BR></P>

<PRE>/usr/lib/acct/accton /var/adm/pacct</PRE>

<P>/var/adm/pacct has information about processes that are running the system. Specifically, /var/adm/pacct has information about the following:

<BR></P>

<UL>

<LI>Who is using the process

<BR>

<BR></LI>

<LI>Group ID's of users using the process

<BR>

<BR></LI>

<LI>The start and elapsed time of the process

<BR>

<BR></LI>

<LI>The CPU timed used

<BR>

<BR></LI>

<LI>The memory used

<BR>

<BR></LI>

<LI>The commands run

<BR>

<BR></LI>

<LI>The tty used to run or use the process.

<BR>

<BR></LI></UL>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> You will find a number of /var/adm/pacct files on your system over a period time. The reason for this is that UNIX runs a program called /usr/lib/acct/ckpacct. ckpacct will be discussed later in this 

chapter, but for now suffice it to say that ckpacct checks the /var/adm/pacct for its size. If the /var/adm/pacct file is more than 500 blocks, ckpacct runs turnacct to move the current pacct file to /var/adm/pacct with an incremented version number 
attached. For instance, /var/adm/pacct would be moved to the free name in /var/adm/pacct<I>#</I> (where <I>#</I> starts with the number 1 and is incremented by one every time an additional /var/adm/pacct is needed). The next time ckpacct runs turnacct, it 

will move the /var/adm/pacct file to /var/adm/pacct1, and so on. This increment insures that the /var/adm/pacct file is kept in sequence and never overwritten.

<BR></NOTE>

<HR ALIGN=CENTER>

<H5 ALIGN="CENTER">

<CENTER><A ID="I8" NAME="I8">

<FONT SIZE=3><B>remove</B>

<BR></FONT></A></CENTER></H5>

<P>/usr/lib/acct/remove will wipe out the /var/adm/acct/sum/pacct and /var/adm/acct/sum/wtmp files. The /var/adm/acct/sum directory contains accumulated summary files for most of the daily files tracked by the accounting system. You wouldn't want the file 

to remain between &quot;reboots&quot; of the accounting system or even the operating system. These files are relevant only from one boot of the accounting system to the next. We will discuss the /var/adm/acct directory later in this chapter.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I9" NAME="I9">

<FONT SIZE=3><B>Login, Run What You Will, and Logout</B>

<BR></FONT></A></CENTER></H4>

<P>In a matter of minutes after the system comes up in multiuser mode, someone logs onto the system. No need to fear: the login and init programs are ready for them. login and init record the user's session by adding a record to the /var/adm/wtmp file. 
Next, the user runs a process, and the UNIX kernel monitors the process and writes a record about this to the /var/adm/pacct file.

<BR></P>

<P>There are other programs that help the accounting periodically. The /usr/lib/acct/ckpacct file, which checks /var/adm/pacct for its size, is run every hour. The ckpacct shell script runs

<BR></P>

<PRE>/usr/lib/acct/turnacct switch</PRE>

<P>to switch the current /var/adm/pacct to an archived file with a version number such as /var/adm/pacct1, /var/adm/pacct2, and so on. These archives will become important when you are recovering from a failure to process these files.

<BR></P>

<P>On a daily basis, the /usr/lib/acct/runacct program is run to create daily and cumulative totals for connections, fees, disk storage, and processes. You will learn more about runacct later in this chapter.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I10" NAME="I10">

<FONT SIZE=3><B>System Shutdown</B>

<BR></FONT></A></CENTER></H4>

<P>When the UNIX system is shut down, the shutdown utility invokes several shell scripts found in the /sbin/rc0.d directory. One of the shells, called k22acct, runs the utility

<BR></P>

<PRE>/usr/lib/acct/shutacct</PRE>

<P>which will write a record into /var/adm/wtmp. The record is called the &quot;reason&quot; record. After this reason is written, the accounting system is then shutdown. Then the shutdown program finishes the system shutdown. See Chapter 34, 
&quot;Starting Up and Shutting Down,&quot; for more information about the shutdown program.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I11" NAME="I11">

<FONT SIZE=4><B>Setting Up and Turning On the System Accounting Option</B>

<BR></FONT></A></CENTER></H3>

<P>There are several things that you need to brush up on before starting the accounting system. The /sbin contains directories that the boot and the shutdown program use. We are concerned with only three of these directories.

<BR></P>

<TABLE BORDER>

<TR>

<TD>

<P>/etc/rc0.d</P>

<TD>

<P>Contains the scripts that are executed during the shutdown process</P>

<TR>

<TD>

<P>/etc/rc2.d</P>

<TD>

<P>Contains the scripts that are executed during the boot process to multiuser mode</P>

<TR>

<TD>

<P>/sbin/init.d/acct</P>

<TD>

<P>Contains the programs (links to shell scripts) that are executed as the UNIX system is being initialized</P></TABLE>

<P>The /etc/rc0.d/K22acct is a shell script that shuts the accounting system down when the system is shutting down. The /etc/rc2.d/S22acct is the shell script that turns on the accounting system. Here is what you do to set up these files:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩久久| 成人永久免费视频| 国产成人精品免费| 91福利在线看| 日本一区二区免费在线观看视频 | 中文字幕av资源一区| 日本成人中文字幕在线视频| aaa欧美色吧激情视频| 2欧美一区二区三区在线观看视频| 亚洲精品国产一区二区三区四区在线| 久久99精品久久久久久久久久久久| 色综合夜色一区| 国产精品视频观看| 毛片基地黄久久久久久天堂| 欧美在线视频全部完| 国产精品久99| 国产91在线|亚洲| 精品电影一区二区| 蜜臀a∨国产成人精品| 欧美日韩精品系列| 亚洲国产一区二区视频| eeuss鲁片一区二区三区| 国产欧美日韩三级| 国产高清精品网站| 久久九九久精品国产免费直播| 日韩在线观看一区二区| 欧美色窝79yyyycom| 亚洲影院理伦片| 91黄视频在线| 亚洲成a人v欧美综合天堂下载| 在线精品视频免费观看| 亚洲精品第一国产综合野| 91色乱码一区二区三区| 亚洲色图欧美偷拍| 91黄色免费看| 视频在线在亚洲| 91精品国产综合久久香蕉的特点| 婷婷中文字幕综合| 日韩一区二区三区电影在线观看| 免费观看一级欧美片| 日韩欧美卡一卡二| 国产一区二区精品在线观看| 久久久久国产精品免费免费搜索 | 日韩制服丝袜av| 精品欧美久久久| 国产盗摄精品一区二区三区在线| 久久网这里都是精品| 国产成人精品影院| 亚洲狼人国产精品| 欧美人体做爰大胆视频| 九九久久精品视频| 中文字幕不卡在线| 欧美性一二三区| 男男视频亚洲欧美| 国产婷婷色一区二区三区四区| 国产91丝袜在线播放九色| 日韩毛片视频在线看| 91成人网在线| 国产在线精品一区二区夜色| 国产三区在线成人av| 色综合视频在线观看| 青青青伊人色综合久久| 国产日韩欧美a| 欧美亚洲国产一区在线观看网站 | 亚洲国产精品人人做人人爽| 宅男在线国产精品| 成人综合在线网站| 视频一区二区中文字幕| 久久九九99视频| 欧美精品在线观看一区二区| 国产精品一品视频| 亚洲福中文字幕伊人影院| 精品国产精品一区二区夜夜嗨| 99精品久久99久久久久| 精品在线亚洲视频| 一区二区三国产精华液| 久久久久久日产精品| 欧美日韩1234| 不卡影院免费观看| 美女被吸乳得到大胸91| 亚洲免费观看高清| 久久精品欧美一区二区三区麻豆| 日本久久精品电影| 成人永久aaa| 国产乱国产乱300精品| 亚洲成人激情av| 中文字幕亚洲精品在线观看| www久久精品| 欧美日韩国产免费一区二区| 不卡一区中文字幕| 在线亚洲高清视频| 成人av电影免费在线播放| 精品一区二区三区的国产在线播放| 一区二区三区小说| 国产精品久99| 亚洲国产精品av| 国产欧美一区二区精品久导航| 在线成人免费视频| 欧美人牲a欧美精品| 色老汉一区二区三区| 91视视频在线观看入口直接观看www | 成人视屏免费看| 久久国产综合精品| 日产精品久久久久久久性色| 亚洲综合免费观看高清完整版在线 | 26uuu欧美| 日韩一区二区不卡| 日韩女优视频免费观看| 日韩欧美国产一区二区三区| 欧美一区永久视频免费观看| 欧美性受极品xxxx喷水| 在线免费观看日本一区| 欧美日韩一级黄| 欧美一区二区性放荡片| 欧美顶级少妇做爰| 91麻豆精品91久久久久同性| 欧美精品精品一区| 91麻豆精品国产自产在线观看一区| 欧美精品日韩精品| 正在播放亚洲一区| 精品久久人人做人人爰| 久久综合色一综合色88| 久久精品视频网| 国产欧美一区二区精品性| 国产精品乱人伦中文| 亚洲视频一区二区在线| 亚洲综合一区二区| 欧美a级理论片| 国产99一区视频免费| 99久久久无码国产精品| 欧美这里有精品| 欧美大片一区二区三区| 久久欧美中文字幕| 亚洲日本va午夜在线影院| 一区二区三区蜜桃网| 日日夜夜免费精品| 国产一区二区影院| 91天堂素人约啪| 欧美精三区欧美精三区| 国产亚洲精品7777| 亚洲男人的天堂在线观看| 日日摸夜夜添夜夜添亚洲女人| 国内不卡的二区三区中文字幕| 99久久精品国产一区| 欧美日韩国产一级| 国产三级精品三级| 香蕉久久一区二区不卡无毒影院 | 亚洲欧洲日韩综合一区二区| 亚洲一区二区三区四区中文字幕| 日本不卡中文字幕| 99在线精品视频| 日韩亚洲欧美成人一区| 中文字幕免费不卡| 五月婷婷激情综合网| 国产成人精品www牛牛影视| 欧美日韩视频专区在线播放| 国产午夜精品美女毛片视频| 天堂av在线一区| av高清久久久| 欧美成人官网二区| 亚洲一区二区三区中文字幕| 国产在线看一区| 欧美男人的天堂一二区| 国产精品麻豆一区二区| 免费观看日韩av| 欧美日韩一级二级| 国产精品久久久久久久久免费桃花| 午夜av一区二区| 91女神在线视频| 国产日本欧洲亚洲| 人禽交欧美网站| 欧美日韩中文国产| 亚洲欧洲av另类| 国产精品影视天天线| 欧美一区二区在线不卡| 夜夜嗨av一区二区三区网页| 东方aⅴ免费观看久久av| 精品国产网站在线观看| 午夜精品福利一区二区蜜股av| 成人av电影免费在线播放| 国产日韩成人精品| 国产一区二区三区美女| 7878成人国产在线观看| 亚洲综合在线视频| 日本韩国精品一区二区在线观看| 国产午夜精品在线观看| 精品一区二区三区免费观看| 日韩一级二级三级| 日韩电影在线一区二区三区| 精品视频一区二区不卡| 亚洲精品成人精品456| 91免费视频观看| 中文字幕一区二区三区蜜月| 成人深夜在线观看| 中文字幕亚洲在| 日本韩国一区二区三区| 亚洲乱码精品一二三四区日韩在线| 成人av集中营| 亚洲欧美偷拍卡通变态| 日本精品一区二区三区高清 |