diff options
author | Wolfram Schlich <wschlich@gentoo.org> | 2008-11-21 18:18:01 +0000 |
---|---|---|
committer | Wolfram Schlich <wschlich@gentoo.org> | 2008-11-21 18:18:01 +0000 |
commit | 9e7f14223ae061efffa99f103c8b9a0d185ea999 (patch) | |
tree | a045614ceddd8842589c79a85e839c11d8b733d7 /sys-block/spindown | |
parent | Version bumped. (diff) | |
download | gentoo-2-9e7f14223ae061efffa99f103c8b9a0d185ea999.tar.gz gentoo-2-9e7f14223ae061efffa99f103c8b9a0d185ea999.tar.bz2 gentoo-2-9e7f14223ae061efffa99f103c8b9a0d185ea999.zip |
initial import
(Portage version: 2.2_rc13/cvs/Linux 2.6.24-gentoo-r5-1 i686)
Diffstat (limited to 'sys-block/spindown')
-rw-r--r-- | sys-block/spindown/files/spindown-0.2.2-CFLAGS.patch | 12 | ||||
-rw-r--r-- | sys-block/spindown/files/spindownd.confd | 14 | ||||
-rw-r--r-- | sys-block/spindown/files/spindownd.initd | 61 |
3 files changed, 87 insertions, 0 deletions
diff --git a/sys-block/spindown/files/spindown-0.2.2-CFLAGS.patch b/sys-block/spindown/files/spindown-0.2.2-CFLAGS.patch new file mode 100644 index 000000000000..b3b2921f5185 --- /dev/null +++ b/sys-block/spindown/files/spindown-0.2.2-CFLAGS.patch @@ -0,0 +1,12 @@ +diff -urN spindown-0.2.2.orig/Makefile spindown-0.2.2/Makefile +--- spindown-0.2.2.orig/Makefile 2008-09-08 14:36:01.000000000 +0200 ++++ spindown-0.2.2/Makefile 2008-11-21 18:52:39.011908499 +0100 +@@ -3,7 +3,7 @@ + VERSION = 0.2.2 + OBJS = diskset.o disk.o thread.o spindown.o iniparser.o dictionary.o log.o + CC = g++ +-CFLAGS =-O1 -pthread ++CFLAGS += -pthread + SRC = src/ + INPARSER = $(SRC)ininiparser3.0b/ + diff --git a/sys-block/spindown/files/spindownd.confd b/sys-block/spindown/files/spindownd.confd new file mode 100644 index 000000000000..b3a3b91266a9 --- /dev/null +++ b/sys-block/spindown/files/spindownd.confd @@ -0,0 +1,14 @@ +# spindownd config file +# default: /etc/spindown.conf +#SPINDOWND_CFG=/etc/spindown.conf + +# spindownd lockfile +# default: /var/lock/spindown.lock +#SPINDOWND_LOCK=/var/lock/spindown.lock + +# spindownd fifo +# default: /var/run/spindown.fifo +#SPINDOWND_FIFO=/var/run/spindown.fifo + +# extra options for spindownd +#SPINDOWND_OPTS="" # you must NOT use -c or -f here! diff --git a/sys-block/spindown/files/spindownd.initd b/sys-block/spindown/files/spindownd.initd new file mode 100644 index 000000000000..1b2cf1bce9ed --- /dev/null +++ b/sys-block/spindown/files/spindownd.initd @@ -0,0 +1,61 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +SPINDOWND_BIN="/usr/sbin/spindownd" +SPINDOWND_CFG=${SPINDOWND_CFG:-/etc/spindown.conf} +SPINDOWND_LOCK=${SPINDOWND_LOCK:-/var/lock/spindown.lock} +SPINDOWND_FIFO=${SPINDOWND_FIFO:-/var/run/spindown.fifo} + +opts="reload" + +depend() { + need localmount + after bootmisc +} + +checkconfig() { + # check for config file + if [ ! -e "${SPINDOWND_CFG}" ]; then + eerror + eerror "The spindownd config file (${SPINDOWND_CFG})" + eerror "is missing!" + eerror + return 1 + fi + # check for leftover lockfile + if [ -f "${SPINDOWND_LOCK}" ]; then + ewarn + ewarn "The spindownd lockfile (${SPINDOWND_LOCK})" + ewarn "exists although the service is not marked as started." + ewarn "Will remove the lockfile and start the service in 10s" + ewarn "if not interrupted..." + ewarn + sleep 10 + if ! rm -f "${SPINDOWND_LOCK}"; then + eerror "Failed to remove the spindownd lockfile (${SPINDOWND_LOCK})" + return 1 + fi + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting spindownd" + start-stop-daemon --start --exec ${SPINDOWND_BIN} \ + -- -c ${SPINDOWND_CFG} -f ${SPINDOWND_FIFO} ${SPINDOWND_OPTS} + eend $? +} + +stop() { + ebegin "Stopping spindownd" + start-stop-daemon --stop --exec ${SPINDOWND_BIN} + eend $? +} + +reload() { + ebegin "Reloading spindownd configuration" + start-stop-daemon --stop --exec ${SPINDOWND_BIN} \ + --signal HUP + eend $? +} |