diff options
Diffstat (limited to 'usr.sbin/accton')
-rw-r--r-- | usr.sbin/accton/Makefile | 7 | ||||
-rw-r--r-- | usr.sbin/accton/accton.8 | 51 | ||||
-rw-r--r-- | usr.sbin/accton/accton.c | 60 |
3 files changed, 118 insertions, 0 deletions
diff --git a/usr.sbin/accton/Makefile b/usr.sbin/accton/Makefile new file mode 100644 index 00000000000..bf1281564dc --- /dev/null +++ b/usr.sbin/accton/Makefile @@ -0,0 +1,7 @@ +# from: @(#)Makefile 5.3 (Berkeley) 5/11/90 +# $Id: Makefile,v 1.1 1995/10/18 08:47:09 deraadt Exp $ + +PROG= accton +MAN= accton.8 + +.include <bsd.prog.mk> diff --git a/usr.sbin/accton/accton.8 b/usr.sbin/accton/accton.8 new file mode 100644 index 00000000000..3e272675afe --- /dev/null +++ b/usr.sbin/accton/accton.8 @@ -0,0 +1,51 @@ +.\" Copyright (c) 1993 Christopher G. Demetriou +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $Id: accton.8,v 1.1 1995/10/18 08:47:09 deraadt Exp $ +.\" +.Dd October 18, 1993 +.Dt ACCTON 8 +.Os BSD 4 +.Sh NAME +.Nm accton +.Nd enable/disable system accounting +.Sh SYNOPSIS +.Nm accton +.Op Ar file +.Sh DESCRIPTION +With an argument naming an existing +.Ar file , +.Nm accton +causes system accounting information for every process executed +to be placed at the end of the file. If no argument is given, +accounting is turned off. +.Sh SEE ALSO +.Xr lastcomm 1 , +.Xr acct 5 +.Sh HISTORY +The +.Nm accton +command has existed nearly forever, but this man page is new. diff --git a/usr.sbin/accton/accton.c b/usr.sbin/accton/accton.c new file mode 100644 index 00000000000..05808544151 --- /dev/null +++ b/usr.sbin/accton/accton.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1988 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif /* not lint */ + +#ifndef lint +/* from: static char sccsid[] = "@(#)accton.c 4.3 (Berkeley) 6/1/90"; */ +static char *rcsid = "$Id: accton.c,v 1.1 1995/10/18 08:47:09 deraadt Exp $"; +#endif /* not lint */ + +#include <stdio.h> + +main(argc, argv) + int argc; + char **argv; +{ + if (argc > 2) { + fputs("usage: accton [file]\n", stderr); + exit(1); + } + if (acct(argc == 2 ? argv[1] : (char *)NULL)) { + perror("accton"); + exit(1); + } + exit(0); +} |