aboutsummaryrefslogtreecommitdiffstats
path: root/testing/uptimed/uptimed.init
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <bpiotrowski@alpinelinux.org>2013-05-29 20:27:51 +0200
committerBartłomiej Piotrowski <bpiotrowski@alpinelinux.org>2013-05-29 20:27:51 +0200
commit7f70bc3131f0c16a55fa63e156bfd7cd0b446c75 (patch)
tree3fe2fcf5db71b1f9b04ee623426b89f45b73320c /testing/uptimed/uptimed.init
parent54a26d3e26ad47888bc4bf7f0dc52e9d0c42414e (diff)
downloadaports-7f70bc3131f0c16a55fa63e156bfd7cd0b446c75.tar.bz2
aports-7f70bc3131f0c16a55fa63e156bfd7cd0b446c75.tar.xz
testing/uptimed: new aport
Diffstat (limited to 'testing/uptimed/uptimed.init')
-rw-r--r--testing/uptimed/uptimed.init26
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
+}