Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/linux-misc-apps/files: freefall.confd freefall.initd
Date: Mon, 29 Dec 2014 00:12:06
Message-Id: 20141229001201.E7E8CE627@oystercatcher.gentoo.org
1 robbat2 14/12/29 00:12:01
2
3 Added: freefall.confd freefall.initd
4 Log:
5 Bump.
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, unsigned Manifest commit)
8
9 Revision Changes Path
10 1.1 sys-apps/linux-misc-apps/files/freefall.confd
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/linux-misc-apps/files/freefall.confd?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/linux-misc-apps/files/freefall.confd?rev=1.1&content-type=text/plain
14
15 Index: freefall.confd
16 ===================================================================
17 # /etc/conf.d/freefall
18
19 # The name of the disk device that hpfall should protect.
20 # Usually this is 'sda' or 'hda' the primary master.
21
22 DISK="sda"
23
24
25
26 1.1 sys-apps/linux-misc-apps/files/freefall.initd
27
28 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/linux-misc-apps/files/freefall.initd?rev=1.1&view=markup
29 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/linux-misc-apps/files/freefall.initd?rev=1.1&content-type=text/plain
30
31 Index: freefall.initd
32 ===================================================================
33 #!/sbin/runscript
34 # Copyright 2012-2014 Gentoo Foundation
35 # Distributed under the terms of the GNU General Public License v2
36 # $Header: /var/cvsroot/gentoo-x86/sys-apps/linux-misc-apps/files/freefall.initd,v 1.1 2014/12/29 00:12:01 robbat2 Exp $
37
38 checkconfig() {
39 if [ -z "$DISK" ] ; then
40 eerror "You need to setup DISK in /etc/conf.d/freefall first"
41 return 1
42 fi
43
44 if [ ! -b /dev/${DISK} ]; then
45 eerror "Could not find disk /dev/${DISK}!"
46 eerror "Adjust the DISK setting in /etc/conf.d/freefall"
47 return 1
48 fi
49
50 if [ ! -e /sys/block/${DISK}/device/unload_heads ] ; then
51 eerror "No protect entry for ${DISK}!"
52 eerror "Kernel 2.6.28 and above is required"
53 return 1
54 fi
55
56 if [ ! -c /dev/freefall ]; then
57 ebegin "Loading hp_accel module"
58 modprobe hp_accel
59 eend $? || return 1
60 fi
61 }
62
63 start () {
64 checkconfig || return 1
65
66 ebegin "Starting active hard-drive protection daemon"
67 start-stop-daemon --start --quiet \
68 --exec /usr/sbin/freefall /dev/${DISK}
69 eend $?
70 }
71
72 stop() {
73 ebegin "Stopping active hard-drive protection daemon"
74 start-stop-daemon --stop --quiet \
75 --exec /usr/sbin/freefall
76 eend $?
77 }