summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2013-01-14 18:08:59 +0000
committerLars Wendler <polynomial-c@gentoo.org>2013-01-14 18:08:59 +0000
commit65869adb337ef6e4b7455e1b39e63c9108d70fe2 (patch)
treebcd916780f4055ddb3a88da96702fef435f2c539 /app-misc
parentAdd an example of the command needed to re-emerge packages with files in /usr... (diff)
downloadgentoo-2-65869adb337ef6e4b7455e1b39e63c9108d70fe2.tar.gz
gentoo-2-65869adb337ef6e4b7455e1b39e63c9108d70fe2.tar.bz2
gentoo-2-65869adb337ef6e4b7455e1b39e63c9108d70fe2.zip
Better fix for bug #448382
(Portage version: 2.2.0_alpha151/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/uptimed/ChangeLog7
-rw-r--r--app-misc/uptimed/files/uptimed.init23
2 files changed, 18 insertions, 12 deletions
diff --git a/app-misc/uptimed/ChangeLog b/app-misc/uptimed/ChangeLog
index bba6430b134c..e6136b896528 100644
--- a/app-misc/uptimed/ChangeLog
+++ b/app-misc/uptimed/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for app-misc/uptimed
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/uptimed/ChangeLog,v 1.86 2012/12/24 10:07:16 polynomial-c Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/uptimed/ChangeLog,v 1.87 2013/01/14 18:08:59 polynomial-c Exp $
+
+ 14 Jan 2013; Lars Wendler <polynomial-c@gentoo.org> files/uptimed.init:
+ Better fix for bug #448382. Thanks to WilliamH for giving the right input.
24 Dec 2012; Lars Wendler <polynomial-c@gentoo.org> files/uptimed.init:
Really fix init script this time.
diff --git a/app-misc/uptimed/files/uptimed.init b/app-misc/uptimed/files/uptimed.init
index 5e1ba1ef354f..1a9307c5af08 100644
--- a/app-misc/uptimed/files/uptimed.init
+++ b/app-misc/uptimed/files/uptimed.init
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/uptimed/files/uptimed.init,v 1.7 2012/12/24 10:07:16 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/uptimed/files/uptimed.init,v 1.8 2013/01/14 18:08:59 polynomial-c Exp $
description="uptimed - a daemon to record uptime records"
pidfile="/var/run/uptimed/uptimed.pid"
@@ -12,12 +12,15 @@ start_stop_daemon_args="-u uptimed"
start_pre() {
checkpath -d -o uptimed ${pidfile%/*}
- # Initialize bootid
- start-stop-daemon --start ${start_stop_daemon_args} --exec ${command} \
- -- -b \
- || eend $?
-
- # Workaround so openrc doesn't see the service as crashed after start
- # (bug #448382).
- mark_service_stopped
+ # Initialize bootid for uptimed < 0.3.17
+ local udver=$(${command} -v | head -n 1 | sed 's@.*[[:space:]]\([[:digit:]\.]\+\)[[:space:]].*@\1@;s@\.@@g')
+ local bootid="/var/spool/uptimed/bootid"
+ if [ "${udver}" -lt "0317" ] ; then
+ ${command} -b || eend $?
+ checkpath -f -o uptimed ${bootid}
+ else
+ if [ -f "${bootid}" ] ; then
+ rm ${bootid}
+ fi
+ fi
}