Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 5111

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<HTML
><HEAD
><TITLE
>init system</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Remote Serial Console HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="Configure getty"
HREF="getty.html"><LINK
REL="PREVIOUS"
TITLE="Configure getty"
HREF="getty.html"><LINK
REL="NEXT"
TITLE="Traditional getty"
HREF="getty-getty.html"></HEAD
><BODY
CLASS="SECTION"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Remote Serial Console HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="getty.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 6. Configure <SPAN
CLASS="PRODUCTNAME"
>getty</SPAN
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="getty-getty.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="GETTY-INIT"
></A
>6.1. <SPAN
CLASS="PRODUCTNAME"
>init</SPAN
> system</H1
><P
>The file <TT
CLASS="FILENAME"
>/etc/inittab</TT
> contains the
   background programs that used to keep the system running.  One of
   these programs is one <SPAN
CLASS="APPLICATION"
>getty</SPAN
> process per
   serial port.</P
><DIV
CLASS="FIGURE"
><A
NAME="GETTY-INIT-INITTAB"
></A
><P
><B
>Figure 6-3. <SPAN
CLASS="APPLICATION"
>getty</SPAN
> is started by
    <SPAN
CLASS="APPLICATION"
>init</SPAN
>, based upon an entry in
    <TT
CLASS="FILENAME"
>/etc/inittab</TT
></B
></P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>co:2345:respawn:/sbin/getty ttyS0 CON9600 vt102</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><P
>Each field in <TT
CLASS="FILENAME"
>inittab</TT
> is separated by a
   colon and contains:</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="LITERAL"
>co</TT
></DT
><DD
><P
>Arbitrary entry for <TT
CLASS="FILENAME"
>inittab</TT
>.  As long
      as this entry doesn't appear anywhere else in
      <TT
CLASS="FILENAME"
>inittab</TT
>, you're okay.  We named this entry
      <TT
CLASS="LITERAL"
>co</TT
> because it's for the console.</P
><P
><SPAN
CLASS="PRODUCTNAME"
>Red Hat Linux</SPAN
>
      <SPAN
CLASS="PRODUCTNUMBER"
>7.3</SPAN
> has a program called
      <SPAN
CLASS="APPLICATION"
>kudzu</SPAN
> which configures the system
      when it is booted.  <SPAN
CLASS="APPLICATION"
>kudzu</SPAN
> treats an
      <TT
CLASS="FILENAME"
>inittab</TT
> entry of <TT
CLASS="LITERAL"
>co</TT
>
      specially, setting it for the attached monitor and keyboard or
      the serial console.  Hardcoding the value of
      <TT
CLASS="FILENAME"
>co</TT
> prevents this behaviour.</P
></DD
><DT
><TT
CLASS="LITERAL"
>2345</TT
></DT
><DD
><P
>Run levels where this entry gets started.  Run levels 2,
      3, 4 and 5 can be used for an operational system,
      <SPAN
CLASS="APPLICATION"
>getty</SPAN
> should not be used in other run
      levels.  The serial console still works in run level 1 (or
      single user mode) even without a
      <SPAN
CLASS="APPLICATION"
>getty</SPAN
>.</P
></DD
><DT
><TT
CLASS="LITERAL"
>respawn</TT
></DT
><DD
><P
>Re-run the program if it dies.  We want this to happen so
      that a new <TT
CLASS="PROMPT"
>login</TT
> prompt will appear when you
      log out of the console.</P
></DD
><DT
><TT
CLASS="LITERAL"
>/sbin/getty ttyS0 CON9600 vt102</TT
></DT
><DD
><P
>The command to run.  In this case, we're telling
      <SPAN
CLASS="APPLICATION"
>getty</SPAN
> to connect to <TT
CLASS="FILENAME"
>/dev/ttyS0</TT
> using the settings for
      <TT
CLASS="LITERAL"
>CON9600</TT
> which exists in
      <TT
CLASS="FILENAME"
>/etc/gettydefs</TT
>.  This entry represents a
      terminal running at 9600<SPAN
CLASS="ABBREV"
>bps</SPAN
>. Initially assume
      that the terminal is a later-model
      <SPAN
CLASS="PRODUCTNAME"
><SPAN
CLASS="ACRONYM"
>VT100</SPAN
></SPAN
>.</P
></DD
></DL
></DIV
><P
>After changing <TT
CLASS="FILENAME"
>/etc/inittab</TT
> restart
   <SPAN
CLASS="APPLICATION"
>init</SPAN
> with</P
><DIV
CLASS="INFORMALFIGURE"
><A
NAME="AEN1544"
></A
><P
></P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
><B
CLASS="COMMAND"
>telinit q</B
></PRE
></FONT
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>An alternative is to send the hangup signal to
   <SPAN
CLASS="APPLICATION"
>init</SPAN
> with the command <B
CLASS="COMMAND"
>kill -HUP
   1</B
>.  This is not recommended: if you make a typing mistake
   and actually kill <SPAN
CLASS="APPLICATION"
>init</SPAN
> then your system
   will suddenly halt.</P
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>Comments in <TT
CLASS="FILENAME"
>inittab</TT
> and Red Hat's
    <SPAN
CLASS="APPLICATION"
>kudzu</SPAN
></B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
><SPAN
CLASS="APPLICATION"
>kudzu</SPAN
> uses the
    <TT
CLASS="LITERAL"
>#</TT
> line comment to activate and deactivate the
    <SPAN
CLASS="APPLICATION"
>getty</SPAN
>s for the attached monitor and
    keyboard and for the serial port.  To prevent a genuine comment
    from becoming confused with a line saved by
    <SPAN
CLASS="APPLICATION"
>kudzu</SPAN
> use <TT
CLASS="LITERAL"
>##</TT
> at the
    start of a line of genuine comments.</P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="getty.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="getty-getty.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Configure <SPAN
CLASS="PRODUCTNAME"
>getty</SPAN
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="getty.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Traditional <SPAN
CLASS="PRODUCTNAME"
>getty</SPAN
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>