Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635262 - sys-process/acct-6.6.4-r3: stabilise (was: ac/sa/etc... fail like: '@WTMP_FILE_LOC@': No such file or directory)
Summary: sys-process/acct-6.6.4-r3: stabilise (was: ac/sa/etc... fail like: '@WTMP_FIL...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Stabilization (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: CC-ARCHES
: 812356 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-24 01:25 UTC by Richard Gray
Modified: 2021-09-18 04:24 UTC (History)
3 users (show)

See Also:
Package list:
sys-process/acct-6.6.4-r3
Runtime testing required: No
nattka: sanity-check+


Attachments
patch sys-process/acct FILESDIR to update locations (1.diff,1.85 KB, patch)
2019-12-08 03:05 UTC, Madhu
no flags Details | Diff
acct patch (acct.patch,636 bytes, patch)
2019-12-08 10:46 UTC, Giuseppe Vitillaro
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Gray 2017-10-24 01:25:22 UTC
emerge --info
Portage 2.3.8 (python 3.4.5-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r4, 4.12.12-gentoo x86_64)
=================================================================
System uname: Linux-4.12.12-gentoo-x86_64-Intel-R-_Pentium-R-_D_CPU_3.00GHz-with-gentoo-2.4.1
KiB Mem:     4049348 total,   1389636 free
KiB Swap:    4194300 total,   4185588 free
Timestamp of repository gentoo: Mon, 23 Oct 2017 22:45:01 +0000
Head commit of repository gentoo: d94b90d7ee42ec302bf80413c53fedb1b4df7df5
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.2.4 [enabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.32.1::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15-r2::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.uk.gentoo.org/gentoo-portage
    priority: -1000

squeezebox
    location: /var/lib/layman/squeezebox
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core2"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/ http://mirror.bytemark.co.uk/gentoo/ rsync://mirror.bytemark.co.uk/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ ftp://ftp.mirrorservice.org/sites/distfiles.gentoo.org/ http://www.mirrorservice.org/sites/distfiles.gentoo.org/ rsync://rsync.mirrorservice.org/distfiles.gentoo.org/"
LANG="en_GB.iso88591"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="aac acl amd64 berkdb bzip2 caps cli cracklib crypt cxx dri faac flac geoip git iconv ipv6 lame modules mp3 multilib ncurses nls nptl ogg openmp openssl pam pcre png readline seccomp session ssl tcpd threads udev unicode wavpack xattr zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_core authn_dbd authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock dbd deflate dir env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en-GB en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

ac, sa and such return an error:-

myserver ~ # ac
couldn't open file '@WTMP_FILE_LOC@': No such file or directory
        total        0.00

myserver ~ # sa
couldn't open file '@ACCT_FILE_LOC@': No such file or directory

Clearly the defaults haven't been set correctly (or at all?). In my /etc/conf.d/acct, everything is commented out. Even if I set the ACCT_LOG variable in /etc/conf.d/acct, the ac and sa programs terminate in error, as above. The /etc/init.d/acct service starts without complaint in any event.
Comment 1 Giuseppe Vitillaro 2017-11-03 10:25:29 UTC
Same problem with sys-process/acct-6.6.4-r1:

couldn't open file '@ACCT_FILE_LOC@': No such file or directory

I guess the problem came from the patch:

 acct-6.6.4-cross-compile.patch
 https://savannah.gnu.org/patch/?7473

Maybe that "mv" command is missing in the ebuild?

svn mv files.h.in files.h 

G. Vitillaro.
Comment 2 Alexandr Paliy 2018-06-22 01:47:05 UTC
Issue is still present.

# equery l acct
 * Searching for acct ...
[IP-] [  ] sys-process/acct-6.6.4-r1:0

# ac --version
ac: GNU Accounting Utilities (release 6.6.4)
# sa --version
sa: GNU Accounting Utilities (release 6.6.4)

# ac
couldn't open file '@WTMP_FILE_LOC@': No such file or directory
        total        0.00
# sa
couldn't open file '@ACCT_FILE_LOC@': No such file or directory
Comment 3 Madhu 2019-12-08 03:03:56 UTC
The patch included by gentoo, files/acct-6.6.4-cross-compile.patch is clearly
bogus and should not have been included in the first place.  It cannot possibly
work as it is - it misunderstands how configure and automake work - and even if
it is corrected [files.h.in should have #define WTMP_FILE_LOC WTMP_FILE ]
it doesn't add any value for gentoo - it just hardcodes what should be configurable at configuration time.

I suggest the patch be dropped. and acct-6.6.4-cross-compile.patch be removed
from FILESDIR.

Other issues:
The other files in in FILESDIR have to be updated for acct as the default
file locations in upstream have changed from /var/log to /var/log/account. 
I'm attaching a patch which updates FILESDIR to reflect the upstream location,

Another issue is acct stops logging if the filesystem with pacct is low
on diskspace. This is adjusted by /proc/sys/kernel/acct sysctls.
Gentoo could package an acct file for etc/sysctl.d but there are issues
about when these settings are applied.

Perhaps the ebuild should print an elog message during installation
alerting the user to the fact that this syctl setting may need to
be adjusted.
Comment 4 Madhu 2019-12-08 03:05:59 UTC
Created attachment 598868 [details, diff]
patch sys-process/acct FILESDIR to update locations

Ref comment 3
Comment 5 Giuseppe Vitillaro 2019-12-08 10:46:58 UTC
Created attachment 598888 [details, diff]
acct patch

You are completely right Madhu, the "acct-6.6.4-cross-compile.patch" is definitely wrong, it hardcodes the acct paths to:

#define WTMP_FILE_LOC "@WTMP_FILE_LOC@"
#define ACCT_FILE_LOC "@ACCT_FILE_LOC@"
#define SAVACCT_FILE_LOC "@SAVACCT_FILE_LOC@"
#define USRACCT_FILE_LOC "@USRACCT_FILE_LOC@

but, in some way, can still be useful.

The really simple patch I attached, hardcode the Gentoo usual acct paths:

#define WTMP_FILE_LOC "/var/log/wtmp"
#define ACCT_FILE_LOC "/var/account/pacct"
#define SAVACCT_FILE_LOC "/var/account/savacct"
#define USRACCT_FILE_LOC "/var/account/usracct
 
and, for what I can see, sys-process/acct-6.6.4-r1 works correctly again, with this user patch applied on top of the Gentoo package without needs of any further change.
Comment 6 Giuseppe Vitillaro 2019-12-08 10:50:16 UTC
Side note. 

This simple "hack" it is probably not a solution, but it can be usefil to other acct users in the meanwhile the problem is definitely solved.

You know, this BUG is open from about 2 years ... ;-)
Comment 7 Larry the Git Cow gentoo-dev 2021-07-24 02:38:29 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1361812f3c383d5dd6e0eb7ce5f9ba41459b9cdf

commit 1361812f3c383d5dd6e0eb7ce5f9ba41459b9cdf
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-07-24 02:37:24 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-07-24 02:38:15 +0000

    sys-process/acct: revbump, fix file paths
    
    before:
    $ sa -h
    ...
    The system's default process accounting files are:
    
      raw process accounting data: @ACCT_FILE_LOC@
          summary by command name: @SAVACCT_FILE_LOC@
              summary by username: @USRACCT_FILE_LOC@
    
    after:
    $ sa -h
    ...
    The system's default process accounting files are:
    
      raw process accounting data: /var/account/pacct
          summary by command name: /var/account/savacct
              summary by username: /var/account/usracct
    
    Bug: https://bugs.gentoo.org/635262
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 sys-process/acct/acct-6.6.4-r2.ebuild              |  46 ++++
 .../files/acct-6.6.4-cross-compile-fixed.patch     | 232 +++++++++++++++++++++
 2 files changed, 278 insertions(+)
Comment 8 Georgy Yakovlev archtester gentoo-dev 2021-07-24 02:40:14 UTC
sorry for taking so long, decided to use sa and discovered this old bug myself.

apparently patch was rebased incorrectly
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-10 04:00:38 UTC
*** Bug 812356 has been marked as a duplicate of this bug. ***
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-11 06:01:29 UTC
x86 done
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-11 06:02:45 UTC
amd64 done
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-11 06:03:28 UTC
arm done
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-11 06:03:39 UTC
arm64 done
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-18 04:24:44 UTC
ppc done

all arches done