Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 411785 - app-misc/uptimed loses its database
Summary: app-misc/uptimed loses its database
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-04-12 18:37 UTC by jjtt
Modified: 2013-06-20 12:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch from Debian Sid (thibaut-truc-detect-corrupt-configuration-file-fixed-filesize-comparison.patch,2.00 KB, patch)
2012-04-12 18:37 UTC, jjtt
Details | Diff
patch from Debian Sid - bootid file is not needed on linux (no-bootid-file-on-linux.patch,2.37 KB, patch)
2012-04-12 18:43 UTC, jjtt
Details | Diff
new ebuild applying the patches (uptimed-0.3.16-r4.ebuild.patch,640 bytes, patch)
2012-04-12 18:50 UTC, jjtt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jjtt 2012-04-12 18:37:03 UTC
Created attachment 308681 [details, diff]
patch from Debian Sid

I've suffered two power cuts this year and on both occasions I had to restore the (very important) uptimed database from a backup.

Googling seems to indicate that the problem is related to how uptimed handles its database (records and records.old) and ext4 filesystem.

I found the attached patch from Debian Sid[1] and tested it. The patch changes the database reading so that if records.old is larger than records, then it will be read instead.




$ emerge --info
Portage 2.1.10.49 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.13-r4, 3.2.1-gentoo-r2 x86_64)
=================================================================
System uname: Linux-3.2.1-gentoo-r2-x86_64-Intel-R-_Core-TM-_i3-2100T_CPU_@_2.50GHz-with-gentoo-2.0.3
Timestamp of tree: Thu, 12 Apr 2012 13:30:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.9.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo oma_overlay
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -mtune=generic -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -mtune=generic -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.mdfnet.se/gentoo http://trumpetti.atm.tut.fi/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 amr asf audiofile berkdb bzip2 cdr cli cracklib crypt css curl cxx dbus dri dts dvb dvd dvdr encode exif faac ffmpeg fortran gdbm gif gnutls gpm gtk iconv imagemagick imap imlib ipv6 jpeg lirc lm_sensors mad mikmod mmx mng modules mp3 mp4 mpd mpeg msn mudflap multilib ncurses nls nptl nptlonly offensive ogg openal opengl openmp oscar pam pcre pdf perl png policykit pop python quicktime readline samba server session sox sse sse2 ssl svg sysfs tcpd truetype udev unicode usb vaapi vorbis x264 xine xinetd xml xorg xv xvid xvmc zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="imonlcd" LIRC_DEVICES="devinput" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON



[1] http://packages.debian.org/sid/uptimed
Comment 1 jjtt 2012-04-12 18:43:27 UTC
Created attachment 308687 [details, diff]
patch from Debian Sid - bootid file is not needed on linux

The Debian package had another patch included which avoids creating a bootid file on linux and reads the information from /proc/stat

I tested both patches together, so I'll include them both in this bug report.
Comment 2 jjtt 2012-04-12 18:50:26 UTC
Created attachment 308689 [details, diff]
new ebuild applying the patches

And the trivial changes to the uptimed-0.3.16-r4.ebuild to apply the patches
Comment 3 Thomas Capricelli 2012-07-01 11:53:14 UTC
I have had the same problem on several computers, all running ext4. it's reproducible : every unexpected shutdown/power off will remove the file and reset the history

ticket at debian's:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474500
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-12-19 16:34:03 UTC
Does this still happen with uptimed-0.3.17?
Comment 5 Thomas Capricelli 2012-12-20 02:04:15 UTC
i'll report here when i know more, but i dont feel like doing a forced shutdown just for the sake of testing this bug :)
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-12-20 08:33:08 UTC
(In reply to comment #5)
> i'll report here when i know more, but i dont feel like doing a forced
> shutdown just for the sake of testing this bug :)

That was by no means what I wanted to request for. Just keep an eye on uptimed once the system experiences another uncommon shutdown.
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-01-14 07:21:52 UTC
I'm setting this bug to TEST-REQUEST.
If you find some similar situation like the ones this problem occured previously please report back if version 0.3.17 fixes this error.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-06-20 12:37:09 UTC
No response and no broken database on any of my machines yet so this seems to be fixed.