From f56221b1b0c153ed9301a9fc9485c9ba27ec87da9559150f2cd4b17392fbdc78 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 15 Jan 2007 22:50:49 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/acct?expand=0&rev=1 --- .gitattributes | 23 +++++ .gitignore | 1 + acct-6.3.5-ac.dif | 60 +++++++++++ acct-6.3.5-acct_v3-fix.diff | 93 +++++++++++++++++ acct-6.3.5-axp.dif | 45 ++++++++ acct-6.3.5-hz.patch | 66 ++++++++++++ acct-6.3.5-info.diff | 14 +++ acct-6.3.5-time-fix.diff | 82 +++++++++++++++ acct-6.3.5-warning.patch | 46 +++++++++ acct-6.3.5.tar.bz2 | 3 + acct.changes | 200 ++++++++++++++++++++++++++++++++++++ acct.spec | 199 +++++++++++++++++++++++++++++++++++ logrotate.acct | 15 +++ rc.acct | 133 ++++++++++++++++++++++++ ready | 0 15 files changed, 980 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 acct-6.3.5-ac.dif create mode 100644 acct-6.3.5-acct_v3-fix.diff create mode 100644 acct-6.3.5-axp.dif create mode 100644 acct-6.3.5-hz.patch create mode 100644 acct-6.3.5-info.diff create mode 100644 acct-6.3.5-time-fix.diff create mode 100644 acct-6.3.5-warning.patch create mode 100644 acct-6.3.5.tar.bz2 create mode 100644 acct.changes create mode 100644 acct.spec create mode 100644 logrotate.acct create mode 100644 rc.acct create mode 100644 ready diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/acct-6.3.5-ac.dif b/acct-6.3.5-ac.dif new file mode 100644 index 0000000..6b86403 --- /dev/null +++ b/acct-6.3.5-ac.dif @@ -0,0 +1,60 @@ +--- Makefile.am ++++ Makefile.am +@@ -11,7 +11,7 @@ + ## From what sources are those programs built? + + ac_SOURCES = ac.c common.c file_rd.c getopt.c getopt1.c hashtab.c \ +- @MKTIME_C@ utmp_rd.c ++ mktime.c utmp_rd.c + ac_LDADD = @ALLOCA@ + + accton_SOURCES = accton.c common.c getopt.c getopt1.c +--- configure.in ++++ configure.in +@@ -6,7 +6,7 @@ + AM_INIT_AUTOMAKE(acct, 6.3.5, no-define-symbols) + AM_CONFIG_HEADER(config.h) + +-AC_ARG_PROGRAM ++dnl AC_ARG_PROGRAM + AC_PROG_CC + if test "x${ac_cv_prog_gcc}" = "xyes"; then + CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes" +@@ -56,7 +56,7 @@ + dnl and whether fields are int/comp_t + dnl + AC_CHECK_HEADER(sys/acct.h, +- AC_DEFINE(HAVE_SYS_ACCT_H) ++ [AC_DEFINE(HAVE_SYS_ACCT_H) + DUMP_ACCT_PROG=dump-acct + ACCTON_PROG=accton + LASTCOMM_PROG=lastcomm +@@ -89,14 +89,14 @@ + AC_HEADER_EGREP(comp_t.*ac_mem, sys/acct.h, + AC_DEFINE(ACMEM_COMPT)) + ) +- AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T)) +- , ++ AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T))] ++ ,[ + dnl + dnl here is the "else" clause for the above AC_CHECK_HEADER + dnl (for older versions of linux, which didn't have a sys/acct.h) + dnl + AC_CHECK_HEADER(linux/acct.h, +- AC_DEFINE(HAVE_LINUX_ACCT_H) ++ [AC_DEFINE(HAVE_LINUX_ACCT_H) + DUMP_ACCT_PROG=dump-acct + ACCTON_PROG=accton + LASTCOMM_PROG=lastcomm +@@ -133,8 +133,8 @@ + AC_DEFINE(ACMEM_COMPT)) + ) + AC_HEADER_EGREP(comp_t, linux/acct.h, AC_DEFINE(HAVE_COMP_T)) +- , ) +-) ++ ]) ++]) + dnl + dnl find out where utmp/pacct are stored + dnl diff --git a/acct-6.3.5-acct_v3-fix.diff b/acct-6.3.5-acct_v3-fix.diff new file mode 100644 index 0000000..9438bfc --- /dev/null +++ b/acct-6.3.5-acct_v3-fix.diff @@ -0,0 +1,93 @@ +--- configure.in ++++ configure.in +@@ -55,46 +55,7 @@ + dnl figure out where acct.h lives + dnl and whether fields are int/comp_t + dnl +-AC_CHECK_HEADER(sys/acct.h, +- [AC_DEFINE(HAVE_SYS_ACCT_H) +- DUMP_ACCT_PROG=dump-acct +- ACCTON_PROG=accton +- LASTCOMM_PROG=lastcomm +- SA_PROG=sa +- ACCTON_MAN=accton.8 +- LASTCOMM_MAN=lastcomm.1 +- SA_MAN=sa.8 +- AC_HEADER_EGREP(ac_utime, sys/acct.h, +- AC_DEFINE(HAVE_ACUTIME) +- AC_HEADER_EGREP(comp_t.*ac_utime, sys/acct.h, +- AC_DEFINE(ACUTIME_COMPT)) +- ) +- AC_HEADER_EGREP(ac_stime, sys/acct.h, +- AC_DEFINE(HAVE_ACSTIME) +- AC_HEADER_EGREP(comp_t.*ac_stime, sys/acct.h, +- AC_DEFINE(ACSTIME_COMPT)) +- ) +- AC_HEADER_EGREP(ac_etime, sys/acct.h, +- AC_DEFINE(HAVE_ACETIME) +- AC_HEADER_EGREP(comp_t.*ac_etime, sys/acct.h, +- AC_DEFINE(ACETIME_COMPT)) +- ) +- AC_HEADER_EGREP(ac_io, sys/acct.h, +- AC_DEFINE(HAVE_ACIO) +- AC_HEADER_EGREP(comp_t.*ac_io, sys/acct.h, +- AC_DEFINE(ACIO_COMPT)) +- ) +- AC_HEADER_EGREP(ac_mem, sys/acct.h, +- AC_DEFINE(HAVE_ACMEM) +- AC_HEADER_EGREP(comp_t.*ac_mem, sys/acct.h, +- AC_DEFINE(ACMEM_COMPT)) +- ) +- AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T))] +- ,[ +- dnl +- dnl here is the "else" clause for the above AC_CHECK_HEADER +- dnl (for older versions of linux, which didn't have a sys/acct.h) +- dnl ++ + AC_CHECK_HEADER(linux/acct.h, + [AC_DEFINE(HAVE_LINUX_ACCT_H) + DUMP_ACCT_PROG=dump-acct +@@ -134,7 +95,6 @@ + ) + AC_HEADER_EGREP(comp_t, linux/acct.h, AC_DEFINE(HAVE_COMP_T)) + ]) +-]) + dnl + dnl find out where utmp/pacct are stored + dnl +--- dump-acct.c ++++ dump-acct.c +@@ -14,7 +14,6 @@ + #include "pacct_rd.h" + #include "getopt.h" + +- + char *program_name; + int debugging_enabled = 0; /* no -- we don't care about bad + records or the file-reading +--- pacct_rd.h ++++ pacct_rd.h +@@ -6,6 +6,10 @@ + + #include "files.h" + ++#ifndef acct ++#define acct acct_v3 ++#endif ++ + /* This looks strange, but it's real ANSI C. */ + + extern struct acct pacct_rd_never_used; +--- sa.c ++++ sa.c +@@ -78,6 +78,9 @@ + #include "hashtab.h" + #include "version.h" + ++#ifndef acct ++#define acct acct_v3 ++#endif + + /* defines, structures, and the like */ + diff --git a/acct-6.3.5-axp.dif b/acct-6.3.5-axp.dif new file mode 100644 index 0000000..8884bd0 --- /dev/null +++ b/acct-6.3.5-axp.dif @@ -0,0 +1,45 @@ +--- accton.c ++++ accton.c +@@ -21,6 +21,7 @@ + + #include "config.h" + ++#include + #include + #include + #include +--- sa.c ++++ sa.c +@@ -1158,27 +1158,17 @@ + + if (print_users) + { +- printf ("%-8.8s" ++ printf ("%-8.8s", uid_name (rec->ac_uid)); + #if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) +- " %6.2f cpu" ++ printf (" %6.2f cpu", ut + st); + #endif + #if defined(HAVE_ACMEM) +- " %8.0fk mem" ++ printf (" %8.0fk mem", mu); + #endif + #ifdef HAVE_ACIO +- " %6.0f io" +-#endif +- " %-*.*s%s\n", +- uid_name (rec->ac_uid), +-#if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) +- ut + st, +-#endif +-#if defined(HAVE_ACMEM) +- mu, +-#endif +-#ifdef HAVE_ACIO +- di, ++ printf (" %6.0f io", di); + #endif ++ printf (" %-*.*s%s\n", + COMM_LEN, COMM_LEN, rec->ac_comm, + (rec->ac_flag & AFORK) ? "*" : ""); + } diff --git a/acct-6.3.5-hz.patch b/acct-6.3.5-hz.patch new file mode 100644 index 0000000..cb77bb0 --- /dev/null +++ b/acct-6.3.5-hz.patch @@ -0,0 +1,66 @@ +--- lastcomm.c ++++ lastcomm.c +@@ -47,6 +47,7 @@ + #endif + + #include ++#include + + #include "common.h" + #include "uid_hash.h" +@@ -65,7 +66,7 @@ + int strict_match_flag = 0; /* Nonzero if each record has to match + all items on the command line */ + int print_controls = 0; /* don't print control characters */ +-int ahz = AHZ; /* for viewing logs from another system */ ++int ahz = 0; /* for viewing logs from another system */ + + char *program_name; /* name of the program, for usage & errs */ + +@@ -91,6 +92,10 @@ + + /* code */ + ++#ifndef HZ ++# define AHZ sysconf(_SC_CLK_TCK) ++#endif ++ + void + main (int argc, char *argv[]) + { +@@ -98,6 +103,7 @@ + int other_pacct_file_specified = 0; /* nonzero if the user used the + `-f' or `--file' flag */ + ++ ahz = AHZ; + program_name = argv[0]; + + /* Tell the pacct reader that we want to do things backwards! */ +--- sa.c ++++ sa.c +@@ -174,7 +174,7 @@ + int print_users = 0; + int percentages = 0; /* include percentages in printout */ + int user_summary_flag = 0; /* are we printing a user summary? */ +-int ahz = AHZ; /* for viewing logs from another system */ ++int ahz = 0; /* for viewing logs from another system */ + + + #if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) +@@ -265,11 +265,16 @@ + + /* code */ + ++#ifndef HZ ++# define AHZ sysconf(_SC_CLK_TCK) ++#endif ++ + void + main (int argc, char *argv[]) + { + int c; + ++ ahz = AHZ; + program_name = argv[0]; + + /* Cache the page size of the machine for the PAGES_TO_KB macro */ diff --git a/acct-6.3.5-info.diff b/acct-6.3.5-info.diff new file mode 100644 index 0000000..2af42bd --- /dev/null +++ b/acct-6.3.5-info.diff @@ -0,0 +1,14 @@ +--- accounting.texi ++++ accounting.texi +@@ -4,6 +4,11 @@ + + @include version.texi + ++@dircategory Miscellaneous ++@direntry ++* acct: (accounting). User specific process accounting. ++@end direntry ++ + @ifinfo + GNU Accounting Utilities + Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. diff --git a/acct-6.3.5-time-fix.diff b/acct-6.3.5-time-fix.diff new file mode 100644 index 0000000..89e750f --- /dev/null +++ b/acct-6.3.5-time-fix.diff @@ -0,0 +1,82 @@ +--- al_share.cpp ++++ al_share.cpp +@@ -114,11 +114,13 @@ + { + if (print_file_problems) + { ++ time_t tmp_time; + utmp_print_file_and_line (stddebug); + fprintf (stddebug, ": problem: time warp (%-24.24s", + ctime (&last_time)); +- fprintf (stddebug, " -> %-24.24s)\n", +- ctime ((time_t *) &(rec->ut_time))); ++ tmp_time = rec->ut_time; ++ fprintf (stddebug, " -> %-24.24s)\n", ++ ctime (&tmp_time)); + } + + #ifdef BACKWARDS +--- lastcomm.c ++++ lastcomm.c +@@ -273,6 +273,7 @@ + parse_entries (void) + { + struct acct *rec; /* the current record */ ++ time_t tmp_time; + + /* loop while there are entries to be had */ + +@@ -349,10 +350,11 @@ + #endif + putchar (' '); + ++ tmp_time = rec->ac_btime; + printf (" %-8.8s %-8.8s %6.2f secs %-16.16s\n", + this_uid, this_dev, + ((ut + st) / (double) ahz), +- ctime (&rec->ac_btime)); ++ ctime (&tmp_time)); + } + } + } +--- pacct_rd.c ++++ pacct_rd.c +@@ -61,6 +61,7 @@ + void + print_pacct_record (struct acct *rec, FILE *out) + { ++ time_t tmp_time; + fprintf (stddebug, "%-*.*s|", COMM_LEN, COMM_LEN, rec->ac_comm); + + #define NUM_FORMAT "%6.1f" +@@ -117,7 +118,8 @@ + ); + #endif + +- fprintf (stddebug, "%s", ctime ((time_t *) &(rec->ac_btime))); ++ tmp_time = rec->ac_btime; ++ fprintf (stddebug, "%s", ctime (&tmp_time)); + } + + +--- utmp_rd.c ++++ utmp_rd.c +@@ -67,6 +67,7 @@ + void + print_utmp_record (struct utmp *rec, FILE *out) + { ++ time_t tmp_time; + if (rec) + { + fprintf (out, "%-*.*s|%-*.*s|", +@@ -117,8 +118,8 @@ + #ifdef HAVE_UT_HOST + fprintf (out, "%-*.*s|", HOST_LEN, HOST_LEN, rec->ut_host); + #endif +- +- fputs (ctime ((time_t *) &(rec->ut_time)), out); ++ tmp_time = rec->ut_time; ++ fputs (ctime (&tmp_time), out); + } + } + diff --git a/acct-6.3.5-warning.patch b/acct-6.3.5-warning.patch new file mode 100644 index 0000000..8e50ccd --- /dev/null +++ b/acct-6.3.5-warning.patch @@ -0,0 +1,46 @@ +--- mktime.c.save 1997-10-14 01:40:36.000000000 +0100 ++++ mktime.c 2006-08-31 09:18:15.000000000 +0100 +@@ -124,9 +124,7 @@ + #define localtime_r my_localtime_r + static struct tm *localtime_r __P ((const time_t *, struct tm *)); + static struct tm * +-localtime_r (t, tp) +- const time_t *t; +- struct tm *tp; ++localtime_r ( const time_t * t, struct tm * tp) + { + struct tm *l = localtime (t); + if (! l) +@@ -144,9 +142,7 @@ + All values are in range, except possibly YEAR. + If overflow occurs, yield the low order bits of the correct answer. */ + static time_t +-ydhms_tm_diff (year, yday, hour, min, sec, tp) +- int year, yday, hour, min, sec; +- const struct tm *tp; ++ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp) + { + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow. time_t overflow is OK, since +@@ -173,8 +169,7 @@ + + /* Convert *TP to a time_t value. */ + time_t +-mktime (tp) +- struct tm *tp; ++mktime (struct tm *tp) + { + #ifdef _LIBC + /* POSIX.1 8.1.1 requires that whenever mktime() is called, the +@@ -192,10 +187,7 @@ + compared to what the result would be for UTC without leap seconds. + If *OFFSET's guess is correct, only one CONVERT call is needed. */ + time_t +-__mktime_internal (tp, convert, offset) +- struct tm *tp; +- struct tm *(*convert) __P ((const time_t *, struct tm *)); +- time_t *offset; ++__mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), time_t *offset) + { + time_t t, dt, t0; + struct tm tm; diff --git a/acct-6.3.5.tar.bz2 b/acct-6.3.5.tar.bz2 new file mode 100644 index 0000000..782ed6a --- /dev/null +++ b/acct-6.3.5.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cedd1c130f290574eafb98cd8302aaf0fa6aea44dd1ab64b91bef3d00a614f62 +size 125622 diff --git a/acct.changes b/acct.changes new file mode 100644 index 0000000..466e67c --- /dev/null +++ b/acct.changes @@ -0,0 +1,200 @@ +------------------------------------------------------------------- +Tue Sep 5 15:32:51 CEST 2006 - anosek@suse.cz + +- fixed compiler warning: old-style function definition + [#203115] (warning.patch) + +------------------------------------------------------------------- +Tue Aug 22 18:58:08 CEST 2006 - postadal@suse.cz + +- define HZ as sysconf(_SC_CLK_TCK) if undefined + +------------------------------------------------------------------- +Wed Jan 25 21:34:06 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Tue Oct 05 12:37:47 CEST 2004 - postadal@suse.cz + +- fixed 64bit problem in printing time [#42969] + +------------------------------------------------------------------- +Mon Oct 04 17:47:43 CEST 2004 - postadal@suse.cz + +- fixed to work with acct v3 format which the new kernel uses [#46768] + +------------------------------------------------------------------- +Thu Feb 12 14:05:04 CET 2004 - ro@suse.de + +- fix owner/group for var/account/pacct + +------------------------------------------------------------------- +Thu Feb 12 12:45:44 CET 2004 - postadal@suse.cz + +-added norootforbuild flag to the spec file + +------------------------------------------------------------------- +Tue Aug 26 11:06:31 CEST 2003 - postadal@suse.cz + +- use new stop_on_removal/restart_on_upate macros + +------------------------------------------------------------------- +Mon May 26 01:06:49 CEST 2003 - ro@suse.de + +- remove unpackaged files from buildroot + +------------------------------------------------------------------- +Thu Apr 24 14:54:01 CEST 2003 - ro@suse.de + +- merge postuns + +------------------------------------------------------------------- +Thu Apr 24 12:20:23 CEST 2003 - ro@suse.de + +- fix install_info --delete call and move from preun to postun + +------------------------------------------------------------------- +Tue Feb 25 15:21:18 CET 2003 - postadal@suse.cz + +- used install-info macros +- fixed accounting.info (dir entry) + +------------------------------------------------------------------- +Mon Sep 9 15:11:42 CEST 2002 - ro@suse.de + +- added logrotate configuration + +------------------------------------------------------------------- +Fri Aug 16 13:07:34 CEST 2002 - postadal@suse.cz + +- added %insserv_prereq, %fillup_prereq and fileutils + to PreReq [#17787] + +------------------------------------------------------------------- +Wed Aug 14 10:44:15 CEST 2002 - poeml@suse.de + +- fix comment in rc.script + +------------------------------------------------------------------- +Tue Apr 2 15:51:10 CEST 2002 - postadal@suse.cz + +- fixed to compile with autoconf-2.53 + +------------------------------------------------------------------- +Mon Feb 25 16:40:13 CET 2002 - postadal@suse.cz + +- modified copyright in /etc/init.d/acct + +------------------------------------------------------------------- +Tue Jan 15 14:20:58 CET 2002 - egmont@suselinux.hu + +- removed colons from startup/shutdown messages + +------------------------------------------------------------------- +Sun Jan 13 12:05:12 CET 2002 - ro@suse.de + +- removed START_ACCT + +------------------------------------------------------------------- +Wed Nov 14 18:02:46 CET 2001 - ro@suse.de + +- don't call automake for now + +------------------------------------------------------------------- +Wed Aug 8 09:54:31 CEST 2001 - cihlar@suse.cz + +- fixed to compile on axp + +------------------------------------------------------------------- +Tue Aug 7 10:04:09 CEST 2001 - cihlar@suse.cz + +- fixed stop and status part of init script +- moved rc.acct and rc.config.acct from patch + +------------------------------------------------------------------- +Mon Jun 25 14:44:12 CEST 2001 - pblaha@suse.cz + +- rewrite init script to conform LSB + +------------------------------------------------------------------- +Wed Dec 13 16:13:39 CET 2000 - smid@suse.cz + +- rcacct link added + +------------------------------------------------------------------- +Tue Nov 28 01:10:25 CET 2000 - ro@suse.de + +- startscript to etc/init.d + +------------------------------------------------------------------- +Thu Nov 2 13:12:49 CET 2000 - smid@suse.cz + +- fix ugly bug in startup scripts + +------------------------------------------------------------------- +Tue Aug 29 21:07:47 CEST 2000 - smid@suse.cz + +- sources => bzip2 +- spec cleanup + +------------------------------------------------------------------- +Wed Jun 7 13:03:42 MEST 2000 - cihlar@suse.cz + +- Copyright tag fixed + +------------------------------------------------------------------- +Fri Apr 7 12:55:16 CEST 2000 - smid@suse.cz + +- upgrade to 6.3.5 +- buildroot added + +------------------------------------------------------------------- +Mon Feb 21 00:35:46 CET 2000 - garloff@suse.de + +- Create /var/account/pacct in script if non-existing + +------------------------------------------------------------------- +Thu Feb 17 10:53:31 CET 2000 - kukuk@suse.de + +- Fix configure options + +------------------------------------------------------------------- +Tue Feb 15 15:51:51 CET 2000 - kukuk@suse.de + +- Fill in group tag + +------------------------------------------------------------------- +Thu Jan 20 17:45:55 CET 2000 - kukuk@suse.de + +- Move /usr/{man,info} -> /usr/share/{man,info} + +------------------------------------------------------------------- +Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de + +- ran old prepare_spec on spec file to switch to new prepare_spec. + +------------------------------------------------------------------- +Wed Apr 7 13:49:51 MEST 1999 - kukuk@suse.de + +- With glibc 2, include linux/acct.h, not sys/acct.h + +------------------------------------------------------------------- +Tue Dec 29 13:28:38 MET 1998 - tmg@suse.de + +- fixed several bugs in init script ;) + +------------------------------------------------------------------- +Sat Dec 12 23:58:07 MET 1998 - bs@suse.de + +- made absolute path in %post to relative path + +------------------------------------------------------------------- +Tue Dec 8 17:28:20 MET 1998 - ro@suse.de + +- updated init script + +------------------------------------------------------------------- +Sun Oct 18 15:05:28 MEST 1998 - tmg@suse.de + +- initial revision diff --git a/acct.spec b/acct.spec new file mode 100644 index 0000000..87e0873 --- /dev/null +++ b/acct.spec @@ -0,0 +1,199 @@ +# +# spec file for package acct (Version 6.3.5) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +Name: acct +License: GPL +Group: System/Base +PreReq: %insserv_prereq %fillup_prereq fileutils %install_info_prereq +Autoreqprov: on +Version: 6.3.5 +Release: 696 +Source: %{name}-%{version}.tar.bz2 +Source1: rc.acct +Source2: logrotate.acct +Patch: %{name}-%{version}-axp.dif +Patch1: %{name}-%{version}-ac.dif +Patch2: %{name}-%{version}-info.diff +Patch3: %{name}-%{version}-acct_v3-fix.diff +Patch4: %{name}-%{version}-time-fix.diff +Patch5: %{name}-%{version}-hz.patch +Patch6: %{name}-%{version}-warning.patch +URL: http://www.gnu.org/directory/acct.html +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Summary: User-Specific Process Accounting + +%description +This package contains the programs necessary for user-specific process +accounting: sa, accton, and lastcomm. + + + +Authors: +-------- + Noel Cragg + +%prep +%setup -q +%patch +%patch1 +%patch2 +%patch3 +%patch4 +%patch5 +%patch6 + +%build +%define prefix /usr +%define sysconfdir /etc +%{suse_update_config} +libtoolize -f +aclocal +automake -a +autoconf +CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \ + --mandir=%{_mandir} \ + --prefix=%{prefix} \ + --infodir=%{_infodir} \ + --sysconfdir=%{sysconfdir} +make + +%install +make DESTDIR=$RPM_BUILD_ROOT install +install -d -m 755 $RPM_BUILD_ROOT/etc/{init.d,logrotate.d} +install -m 755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/acct +install -m 755 %{S:2} $RPM_BUILD_ROOT/etc/logrotate.d/acct +install -d -m 755 $RPM_BUILD_ROOT/var/account/ +touch $RPM_BUILD_ROOT/var/account/pacct +chmod 600 $RPM_BUILD_ROOT/var/account/pacct +cd $RPM_BUILD_ROOT/usr/sbin/ +ln -sf ../../etc/init.d/acct rcacct +rm -f $RPM_BUILD_ROOT/usr/bin/last +rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/last.1* + +%post +%{fillup_and_insserv acct} +echo "Creating /var/account/pacct" +touch var/account/pacct +chmod 600 var/account/pacct +%install_info --info-dir=%{_infodir} %{_infodir}/accounting.info.gz + +%preun +%stop_on_removal acct + +%postun +%install_info_delete --info-dir=%{_infodir} %{_infodir}/accounting.info.gz +%restart_on_update acct +%{insserv_cleanup} + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) +%doc README NEWS +%doc %{_infodir}/*.info.* +%doc %{_mandir}/man1/ac* +%doc %{_mandir}/man1/lastcomm* +%doc %{_mandir}/man8/* +%dir /var/account +%attr(600, root, root) %ghost /var/account/pacct +%config /etc/logrotate.d/acct +%config /etc/init.d/acct +/usr/bin/ac +/usr/bin/lastcomm +/usr/sbin/* + +%changelog -n acct +* Tue Sep 05 2006 - anosek@suse.cz +- fixed compiler warning: old-style function definition + [#203115] (warning.patch) +* Tue Aug 22 2006 - postadal@suse.cz +- define HZ as sysconf(_SC_CLK_TCK) if undefined +* Wed Jan 25 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Tue Oct 05 2004 - postadal@suse.cz +- fixed 64bit problem in printing time [#42969] +* Mon Oct 04 2004 - postadal@suse.cz +- fixed to work with acct v3 format which the new kernel uses [#46768] +* Thu Feb 12 2004 - ro@suse.de +- fix owner/group for var/account/pacct +* Thu Feb 12 2004 - postadal@suse.cz +-added norootforbuild flag to the spec file +* Tue Aug 26 2003 - postadal@suse.cz +- use new stop_on_removal/restart_on_upate macros +* Mon May 26 2003 - ro@suse.de +- remove unpackaged files from buildroot +* Thu Apr 24 2003 - ro@suse.de +- merge postuns +* Thu Apr 24 2003 - ro@suse.de +- fix install_info --delete call and move from preun to postun +* Tue Feb 25 2003 - postadal@suse.cz +- used install-info macros +- fixed accounting.info (dir entry) +* Mon Sep 09 2002 - ro@suse.de +- added logrotate configuration +* Fri Aug 16 2002 - postadal@suse.cz +- added %%insserv_prereq, %%fillup_prereq and fileutils + to PreReq [#17787] +* Wed Aug 14 2002 - poeml@suse.de +- fix comment in rc.script +* Tue Apr 02 2002 - postadal@suse.cz +- fixed to compile with autoconf-2.53 +* Mon Feb 25 2002 - postadal@suse.cz +- modified copyright in /etc/init.d/acct +* Tue Jan 15 2002 - egmont@suselinux.hu +- removed colons from startup/shutdown messages +* Sun Jan 13 2002 - ro@suse.de +- removed START_ACCT +* Wed Nov 14 2001 - ro@suse.de +- don't call automake for now +* Wed Aug 08 2001 - cihlar@suse.cz +- fixed to compile on axp +* Tue Aug 07 2001 - cihlar@suse.cz +- fixed stop and status part of init script +- moved rc.acct and rc.config.acct from patch +* Mon Jun 25 2001 - pblaha@suse.cz +- rewrite init script to conform LSB +* Wed Dec 13 2000 - smid@suse.cz +- rcacct link added +* Tue Nov 28 2000 - ro@suse.de +- startscript to etc/init.d +* Thu Nov 02 2000 - smid@suse.cz +- fix ugly bug in startup scripts +* Tue Aug 29 2000 - smid@suse.cz +- sources => bzip2 +- spec cleanup +* Wed Jun 07 2000 - cihlar@suse.cz +- Copyright tag fixed +* Fri Apr 07 2000 - smid@suse.cz +- upgrade to 6.3.5 +- buildroot added +* Mon Feb 21 2000 - garloff@suse.de +- Create /var/account/pacct in script if non-existing +* Thu Feb 17 2000 - kukuk@suse.de +- Fix configure options +* Tue Feb 15 2000 - kukuk@suse.de +- Fill in group tag +* Thu Jan 20 2000 - kukuk@suse.de +- Move /usr/{man,info} -> /usr/share/{man,info} +* Mon Sep 13 1999 - bs@suse.de +- ran old prepare_spec on spec file to switch to new prepare_spec. +* Wed Apr 07 1999 - kukuk@suse.de +- With glibc 2, include linux/acct.h, not sys/acct.h +* Tue Dec 29 1998 - tmg@suse.de +- fixed several bugs in init script ;) +* Sat Dec 12 1998 - bs@suse.de +- made absolute path in %%post to relative path +* Tue Dec 08 1998 - ro@suse.de +- updated init script +* Sun Oct 18 1998 - tmg@suse.de +- initial revision diff --git a/logrotate.acct b/logrotate.acct new file mode 100644 index 0000000..ff2e77e --- /dev/null +++ b/logrotate.acct @@ -0,0 +1,15 @@ +/var/account/pacct { + compress + dateext + maxage 365 + rotate 99 + size=+4096k + notifempty + missingok + create 640 root root + postrotate + /etc/init.d/acct force-reload + endscript +} + + diff --git a/rc.acct b/rc.acct new file mode 100644 index 0000000..e023050 --- /dev/null +++ b/rc.acct @@ -0,0 +1,133 @@ +#! /bin/sh +# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany. +# Copyright (c) 2002 SuSE Linux AG, Nuernberg, Germany +# +# Author: Petr Blaha +# +# init.d/acct +# +# and symbolic its link +# +# /sbin/rcacct +# +# System startup script for process accounting +# +### BEGIN INIT INFO +# Provides: acct +# Required-Start: $syslog $local_fs +# Required-Stop: $syslog $local_fs +# Default-Start: 2 3 5 +# Default-Stop: 0 1 6 +# Description: Process accounting +### END INIT INFO + + +ACCT_BIN=/usr/sbin/accton +test -x $ACCT_BIN || exit 5 + + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v ditto but be verbose in local rc status +# rc_status -v -r ditto and clear the local rc status +# rc_failed set local and overall rc status to failed +# rc_failed set local and overall rc status to +# rc_reset clear local rc status (overall remains) +# rc_exit exit appropriate to overall rc status +. /etc/rc.status + +# First reset status of this service +rc_reset + +# Return values acc. to LSB for all commands but status: +# 0 - success +# 1 - generic or unspecified error +# 2 - invalid or excess argument(s) +# 3 - unimplemented feature (e.g. "reload") +# 4 - insufficient privilege +# 5 - program is not installed +# 6 - program is not configured +# 7 - program is not running +# +# Note that starting an already running service, stopping +# or restarting a not-running service as well as the restart +# with force-reload (in case signalling is not supported) are +# considered a success. + +case "$1" in + start) + echo -n "Starting process accounting" + test -e /var/account/pacct || touch /var/account/pacct + + ## Start process accounting + $ACCT_BIN /var/account/pacct && touch /var/run/accton + + # Remember status and be verbose + rc_status -v + ;; + stop) + echo -n "Shutting down process accounting" + ## Stop daemon with killproc(8) and if this fails + ## set echo the echo return value. + $ACCT_BIN && rm -f /var/run/accton + + # Remember status and be verbose + rc_status -v + ;; + try-restart) + ## Stop the service and if this succeeds (i.e. the + ## service was running before), start it again. + ## Note: try-restart is not (yet) part of LSB (as of 0.7.5) + $0 status >/dev/null && $0 restart + + # Remember status and be quiet + rc_status + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + $0 stop + $0 start + + # Remember status and be quiet + rc_status + ;; + force-reload) + ## Signal the daemon to reload its config. Most daemons + ## do this on signal 1 (SIGHUP). + ## If it does not support it, restart. + + echo -n "Reload process accounting" + $0 stop && $0 start + rc_status + ;; + reload) + ## Like force-reload, but if daemon does not support + ## signalling, do nothing (!) + + rc_failed 3 + rc_status -v + ;; + status) + echo -n "Status of process accounting: " + + # Status has a slightly different for the status command: + # 0 - service running + # 1 - service dead, but /var/run/ pid file exists + # 2 - service dead, but /var/lock/ lock file exists + # 3 - service not running + + if test -e /var/run/accton ; then echo "OK" + else + echo "No" + exit 3 + fi + #rc_status + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" + exit 1 + ;; +esac +rc_exit diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4