blob: 0c8930208e80c923d0f23178e86e6af43fb741a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!/bin/sh
#
# Checks if a partition is close to full up
#
# description: Checks if a partition is close to full up
# chkconfig: 345 13 20
#
### BEGIN INIT INFO
# Provides: partmon
# Default-Start: 3 4 5
# Short-Description: Checks if a partition is close to full up
# Description: Checks if a partition is close to full up
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# The following file prevents from "starting" again when changing
# runlevel
SYSCONF_FILE=/var/lock/subsys/partmon
# See how we were called.
case "$1" in
start)
gprintf "Checking if partitions have enough free diskspace: "
str=$(/usr/bin/partmon)
if [ "$str" = "" ]; then
echo_success
touch $SYSCONF_FILE
else
echo # to start to print problems at column 0
echo "$str"
echo_failure
echo
exit 1
fi
echo
;;
stop)
rm -f $SYSCONF_FILE
;;
status)
if [ -f $SYSCONF_FILE ]
then
gprintf "partmon has been started"
else
gprintf "partmon has not been started, or check gave a failure"
fi
;;
restart)
$0 stop
$0 start
;;
*)
gprintf "Usage: %s\n" "$0 {start|stop|restart|status}"
exit 1
esac
exit 0
|