⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 429-431.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Using Linux:Managing Scheduling Services</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0789716232//-->

<!--TITLE=Using Linux//-->

<!--AUTHOR=William Ball//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Que//-->

<!--CHAPTER=26//-->

<!--PAGES=429-431//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch25/425-427.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="431-434.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H2><A NAME="Heading1"></A><FONT COLOR="#000077">CHAPTER 26<BR>Managing Scheduling Services

</FONT></H2>

<P><I>By David Pitts</I></P>

<DL>

<DD>Configuring <TT>inittab</TT> and <TT>rc</TT> files

<DD>Configuring <TT>crontab</TT> scheduling service

<DD>Configuring the at command service

</DL>

<P>Scheduling resources is a management process. Whether you are scheduling a workforce, a tournament, or class load, you are required to look at each piece from the perspective of the whole. For example, it is good to take English and math in high school, but it is not good to schedule them both at 9:00 in the morning. Part of scheduling, then, is making sure that there are enough resources for all the work. There is only one you, and you can be in only one class at a time.

</P>

<P>Scheduling a computer&#146;s resources is also a management process. Certain processes, by their very nature, use more of the computer&#146;s resources than other processes. Some require dedicated time or dedicated access, whereas other processes manage regardless. As the system administrator, it is your job to manage all the processes so that maximum efficiency is achieved, and so that the users can get their work done with as little interruption as possible. Fortunately, there are tools that allow you to manage your resources, and even start and stop processes when you are not around. Scheduling services are broken down into three areas:</P>

<DL>

<DD><B>&#149;</B>&nbsp;&nbsp;Processes that run all the time (or once, but always at startup)

<DD><B>&#149;</B>&nbsp;&nbsp;Processes that run repeatedly, at a specific time or on a specific day

<DD><B>&#149;</B>&nbsp;&nbsp;Processes that run only occasionally

</DL>

<P>For processes that run all the time, you have two tools: <TT>inittab</TT> and the <TT>rc</TT> files. For processes that run repeatedly, at a specific time or on a specific date, you have the <TT>crontab</TT> tool. For processes that need to be run only occasionally, you have the at tool.</P>

<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Configuring <I>inittab</I> and <I>rc</I> Files

</FONT></H3>

<P>Before discussing the ins and outs of <TT>inittab</TT> and <TT>rc</TT> files, a brief discussion is needed on <TT>init</TT>, the parent process of <TT>inittab</TT>. When <TT>init</TT> is kicked off, it reads the file <TT>/etc/inittab</TT>, which tells <TT>init</TT> what to do. Usually, it tells <TT>init</TT> to allow user logons (<TT>gettys</TT>), and controls autonomous processes and other &#147;at boot time&#148; processes.</P>

<P>The <TT>init</TT> process can run at one of 15 levels. The run level is changed by having a privileged user (root) run <TT>/sbin/telinit</TT>, which sends appropriate signals to <TT>init</TT>, telling it which run level to change to.</P>

<P>After it has spawned all its processes, <TT>init</TT> waits for one of its child processes to die, for a power fail signal, or for a signal from <TT>/sbin/telinit</TT> to change the system&#146;s run level. When one of these changes occurs, the <TT>/etc/inittab</TT> file is reexamined. Although new entries can be added to this file at any time, <TT>init</TT> does not read them until one of these three events occurs.</P>

<H4 ALIGN="LEFT"><A NAME="Heading3"></A><FONT COLOR="#000077">The <I>inittab</I> File

</FONT></H4>

<P>The <TT>inittab</TT> file, which tells <TT>init</TT> what to do, is a list of colon-delimited entries that use the following format:</P>

<!-- CODE SNIP //-->

<PRE>

<I>id:runlevels:action:process</I>

</PRE>

<!-- END CODE SNIP //-->



<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">

<TR><TD><FONT SIZE="+1"><B>Understanding the contents of the inittab file</B></FONT>

<BR>Lines beginning with a pound sign (<TT>#</TT>) are comments, and are ignored. Any other lines define processes to be run.</TABLE>



<P>Table 26.1 examines and describes each of these entries.

</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 26.1</B> The makeup of each line in the <I>inittab</I> file

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="30%" ALIGN="LEFT">Entry

<TH WIDTH="70%" ALIGN="LEFT">Description

<TR>

<TD VALIGN="TOP"><TT>id</TT>

<TD>Identifies a unique sequence of 1&#150;4 characters, which identifies an entry.

<TR>

<TD><TT>runlevel</TT>

<TD>Describes at which run level this action should occur.

<TR>

<TD><TT>action

<TD>Dictates which action is to be taken.

<TR>

<TD VALIGN="TOP"><TT>process</TT>

<TD>Specifies the process to be executed. If the process field starts with a <TT>&#43;</TT>, <TT>init</TT> does not do <TT>utmp</TT> and <TT>wtmp</TT> accounting for that process.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch25/425-427.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="431-434.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -