Subversion Repositories configs

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#!/bin/bash
2
#
3
# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
4
#
5
# This copyrighted material is made available to anyone wishing to use,
6
# modify, copy, or redistribute it subject to the terms and conditions
7
# of the GNU General Public License v.2.
8
#
9
# You should have received a copy of the GNU General Public License
10
# along with this program; if not, write to the Free Software Foundation,
57 - 11
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
3 - 12
#
13
# This file is part of LVM2.
14
# It is required for the proper handling of failures of LVM2 mirror
15
# devices that were created using the -m option of lvcreate.
16
#
17
#
18
# chkconfig: 12345 02 99
19
# description: Starts and stops LVM metadata daemon
20
#
21
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
22
#
23
### BEGIN INIT INFO
24
# Provides: lvm2-lvmetad
25
# Required-Start: $local_fs
26
# Required-Stop: $local_fs
27
# Default-Start: 1 2 3 4 5
28
# Default-Stop: 0 6
29
# Short-Description: A daemon that maintains LVM metadata state for improved
30
#                    performance by avoiding further scans while running
31
#                    subsequent LVM commands or while using lvm2app library.
32
### END INIT INFO
33
 
34
. /etc/init.d/functions
35
 
36
DAEMON=lvmetad
37
 
38
exec_prefix=
39
sbindir=/sbin
40
 
41
LOCK_FILE="/var/lock/subsys/$DAEMON"
42
PID_FILE="/var/run/lvmetad.pid"
43
 
44
rh_status() {
45
	status -p $PID_FILE $DAEMON
46
}
47
 
48
rh_status_q() {
49
	rh_status >/dev/null 2>&1
50
}
51
 
52
start()
53
{
54
	ret=0
55
	action "Starting LVM metadata daemon:" $DAEMON || ret=$?
56
	return $ret
57
}
58
 
59
 
60
stop()
61
{
62
	ret=0
63
	action "Signaling LVM metadata daemon to exit:" killproc -p $PID_FILE $DAEMON -TERM || ret=$?
64
	return $ret
65
}
66
 
67
rtrn=1
68
 
69
# See how we were called.
70
case "$1" in
71
  start)
72
	rh_status_q && exit 0
73
	start
74
	rtrn=$?
75
	[ $rtrn = 0 ] && touch $LOCK_FILE
76
	;;
77
 
78
  stop|force-stop)
79
	rh_status_q || exit 0
80
	stop
81
	rtrn=$?
82
	[ $rtrn = 0 ] && rm -f $LOCK_FILE
83
	;;
84
 
85
  restart)
86
	if stop
87
	then
88
		start
89
	fi
90
	rtrn=$?
91
	;;
92
 
93
  condrestart|try-restart)
94
	rh_status_q || exit 0
95
	if stop
96
	then
97
		start
98
	fi
99
	rtrn=$?
100
	;;
101
 
102
  status)
103
	rh_status
104
	rtrn=$?
105
	;;
106
 
107
  *)
108
	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
109
	;;
110
esac
111
 
112
exit $rtrn