old-www/HOWTO/Process-Accounting/pasetup.html

222 lines
3.2 KiB
HTML

<HTML
><HEAD
><TITLE
>Process Accounting Setup on Linux</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.60"><LINK
REL="HOME"
TITLE="Enabling Process Accounting on Linux HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Requirements for Process Accounting on Linux"
HREF="requirements.html"><LINK
REL="NEXT"
TITLE="Miscellaneous Process Accounting Commands"
HREF="misccommands.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Enabling Process Accounting on Linux HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="requirements.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="misccommands.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="PASETUP"
>6. Process Accounting Setup on Linux</A
></H1
><P
></P
><OL
TYPE="1"
><LI
><P
>Compile and install process accounting software.</P
><P
>The process accounting software package is available from
<A
HREF="http://sunsite.unc.edu/pub/Linux/system/admin/quota-acct-modified.tgz"
TARGET="_top"
>http://sunsite.unc.edu/pub/Linux/system/admin/quota-acct-modified.tgz</A
>
</P
></LI
><LI
><P
>Modify your system init script and turn on process accounting
at boot time.</P
><P
>Here's an example:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><PRE
CLASS="SCREEN"
># Turn process accounting on.
if [ -x /sbin/accton ]
then
/sbin/accton /var/log/pacct
echo "Process accounting turned on."
fi
</PRE
></TD
></TR
></TABLE
></LI
><LI
><P
>Create accounting record file <TT
CLASS="FILENAME"
>"pacct."</TT
> </P
><P
>Your process accounting software will print out all commands
executed to the file <TT
CLASS="FILENAME"
>/var/log/pacct</TT
> by default. </P
><P
>To create the accounting record file:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><PRE
CLASS="SCREEN"
>touch /var/log/pacct</PRE
></TD
></TR
></TABLE
> </P
><P
>This record file should be owned by root, and it has read-write
permission for root and read permission for anybody else: </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><PRE
CLASS="SCREEN"
>chown root /var/log/pacct
chmod 0644 /var/log/pacct</PRE
></TD
></TR
></TABLE
></LI
><LI
><P
>Reboot.</P
><P
>Now reboot your system for changes you made to take effect.
</P
></LI
></OL
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="requirements.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="misccommands.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Requirements for Process Accounting on Linux</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Miscellaneous Process Accounting Commands</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>