From owner-freebsd-questions Thu Nov 9 13: 3:40 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-149-77.mmcable.com [24.27.149.77]) by hub.freebsd.org (Postfix) with SMTP id AD51B37B479 for ; Thu, 9 Nov 2000 13:03:38 -0800 (PST) Received: (qmail 25341 invoked by uid 100); 9 Nov 2000 21:03:34 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14859.4390.604607.588672@guru.mired.org> Date: Thu, 9 Nov 2000 15:03:34 -0600 (CST) To: - Cc: questions@freebsd.org Subject: Re: Process Log In-Reply-To: <12111063@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG - types: > How can I have a log of all the processes started by the system? In a > format similar to 'ps'. Similar to *which* ps format? And some of the information from ps isn't really relevant (pid, resident set size, CPU STATE, etc.) Anyway, you can start collecting statistics by doing: # mkdir /var/account # touch /var/account/acct # accton /var/account/acct Setting accounting_enable="YES" in /etc/rc.conf will cause it to be turned on during the boot process (but you'll miss processes that exit before it's turned on). The lastcomm and sa commands will then print information about the processes. If you can't use those to get a format acceptable to you, then look at /usr/include/sys/acct.h; that's the format for the records in the log file. Writing a program that prints what you want is the second most trivial interesting program you can write ("Hello world" isn't interesting, cat is the first, cat with reformatting is the second, and that's what you're doing).