diff options
Diffstat (limited to 'testing/uptimed/uptimed.init')
-rw-r--r-- | testing/uptimed/uptimed.init | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/uptimed/uptimed.init b/testing/uptimed/uptimed.init new file mode 100644 index 0000000000..1a9307c5af --- /dev/null +++ b/testing/uptimed/uptimed.init @@ -0,0 +1,26 @@ +#!/sbin/runscript +# 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.8 2013/01/14 18:08:59 polynomial-c Exp $ + +description="uptimed - a daemon to record uptime records" +pidfile="/var/run/uptimed/uptimed.pid" +command="/usr/sbin/uptimed" +command_args="-p ${pidfile}" +start_stop_daemon_args="-u uptimed" + +start_pre() { + checkpath -d -o uptimed ${pidfile%/*} + + # 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 +} |