You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/uptimed/files/uptimed.init

27 lines
845 B

#!/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
}