summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Armak <danarmak@gentoo.org>2001-07-24 08:33:34 +0000
committerDan Armak <danarmak@gentoo.org>2001-07-24 08:33:34 +0000
commit39ca886b5c97256bdfa74ab88f4dd6e5da93804b (patch)
tree8d78277f9c0b4147fab5fc4aae875e3f9423ca48 /sys-apps/noflushd
parentFix of stupid syntax mistake. Init script should work all the time now. (diff)
downloadhistorical-39ca886b5c97256bdfa74ab88f4dd6e5da93804b.tar.gz
historical-39ca886b5c97256bdfa74ab88f4dd6e5da93804b.tar.bz2
historical-39ca886b5c97256bdfa74ab88f4dd6e5da93804b.zip
I *knew* my config system was idiotic! Turns out profile.env vars aren't available in init scripts. Removed /etc/env.d/70noflushd and added a small config file of my own under /etc/noflushd.conf. If anyone already intalled this since yesterday, plesae upgrade and tell me what the new problem is.
Diffstat (limited to 'sys-apps/noflushd')
-rw-r--r--sys-apps/noflushd/files/70noflushd10
-rw-r--r--sys-apps/noflushd/files/noflushd19
-rw-r--r--sys-apps/noflushd/files/noflushd.conf14
-rw-r--r--sys-apps/noflushd/noflushd-2.4.ebuild18
4 files changed, 36 insertions, 25 deletions
diff --git a/sys-apps/noflushd/files/70noflushd b/sys-apps/noflushd/files/70noflushd
deleted file mode 100644
index 333833341c08..000000000000
--- a/sys-apps/noflushd/files/70noflushd
+++ /dev/null
@@ -1,10 +0,0 @@
-# Settings for the noflushd daemon:
-
-# Default timeout in minutes to sipn down disk
-NOFLUSHD_TIMEOUT=60
-
-# Disks to handle
-NOFLUSHD_DISKS='/dev/discs/disc0/disc'
-
-# Run 'noflushd -h' to find out how to set individual timeouts
-# for different discs. \ No newline at end of file
diff --git a/sys-apps/noflushd/files/noflushd b/sys-apps/noflushd/files/noflushd
index ddf280be20ad..a9b673f35222 100644
--- a/sys-apps/noflushd/files/noflushd
+++ b/sys-apps/noflushd/files/noflushd
@@ -11,9 +11,21 @@ PIDFILE=/var/run/noflushd.pid
EXE=/usr/sbin/noflushd
start() {
- ebegin "Starting $SERVICE"
- start-stop-daemon --start --quiet --exec "$EXE" -- -n $NOFLUSHD_TIMEOUT $NOFLUSHD_DISKS
- eend $? "Started $SERVICE." "Error starting $SERVICE."
+
+ # defaults
+ TIMEOUT=60
+ DISKS='/dev/discs/disc0/disc'
+ EXTRA=''
+
+ # Pull in configuration file if exists, overrides defaults
+ [ -f /etc/noflushd.conf ] && . /etc/noflushd.conf
+
+ OPTIONS='-n $TIMEOUT $DISKS $EXTRA'
+
+ ebegin "Starting $SERVICE"
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $EXE -- $OPTIONS
+ eend $? "Started $SERVICE." "Error starting $SERVICE."
+
}
stop() {
@@ -24,6 +36,7 @@ stop() {
restart() {
stop
+ sleep 1s
start
}
diff --git a/sys-apps/noflushd/files/noflushd.conf b/sys-apps/noflushd/files/noflushd.conf
new file mode 100644
index 000000000000..2d2fd841a13b
--- /dev/null
+++ b/sys-apps/noflushd/files/noflushd.conf
@@ -0,0 +1,14 @@
+# /etc/noflushd.conf, settings for the noflushd daemon.
+# Part of the Gentoo Linux noflushd package. Dan Armak <danarmak@gentoo.org>
+
+# Default timeout in minutes to spin down disk
+TIMEOUT=60
+
+# Disks to handle
+DISKS='/dev/discs/disc0/disc'
+
+# Extra options to pass e.g. individual disk handling options
+EXTRA=''
+
+# Run 'noflushd -h' to find out how to set individual timeouts
+# for different discs. \ No newline at end of file
diff --git a/sys-apps/noflushd/noflushd-2.4.ebuild b/sys-apps/noflushd/noflushd-2.4.ebuild
index 19ee0ba2c466..4f41350c49e5 100644
--- a/sys-apps/noflushd/noflushd-2.4.ebuild
+++ b/sys-apps/noflushd/noflushd-2.4.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2001 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/noflushd/noflushd-2.4.ebuild,v 1.1 2001/07/23 19:47:01 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/noflushd/noflushd-2.4.ebuild,v 1.2 2001/07/24 08:33:34 danarmak Exp $
# Note: the daemon's current 2.4 version has nothing to do with kernel versions
#P=""
@@ -42,26 +42,20 @@ src_install () {
exeinto /etc/rc.d/init.d
doexe ${FILESDIR}/noflushd
- insinto /etc/env.d
- doins ${FILESDIR}/70noflushd
+ insinto /etc
+ doins ${FILESDIR}/noflushd.conf
}
pkg_postinst() {
- # try to enable env-update settings
- . /etc/profile.env
-
echo "
- Run rc-update add noflushd to add it to runlevels 2 3 4.
+ Run 'rc-update add noflushd' to add it to runlevels 2 3 4.
- Edit /etc/env.d/70noflushd to change the default spindown
+ Edit /etc/noflushd.conf to change the default spindown
timeout and the disks handled; the defaults are 60 minutes
and /dev/discs/disc0/disc (i.e. hda).
-
- NOTE: you should re-login for the env-update changes to take
- effect before you run noflushd for the first time.
-
+
WARNING:
WARNING: Do NOT use with SCSI, unstable!
WARNING: