#!/bin/bash # # This file is part of LVM2. # It is required for the proper handling of failures of LVM2 mirror # devices that were created using the -m option of lvcreate. # # # chkconfig: 12345 02 99 # description: Starts and stops LVM metadata daemon # processname: lvmetad # pidfile: /var/run/lvmetad.pi # ### BEGIN INIT INFO # Provides: lvm2-lvmetad # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: 1 2 3 4 5 # Default-Stop: 0 6 # Short-Description: A daemon that maintains LVM metadata state for improved # performance by avoiding further scans while running # subsequent LVM commands or while using lvm2app library. ### END INIT INFO WITHOUT_RC_COMPAT=1 . /etc/init.d/functions DAEMON=lvmetad LOCKFILE="/var/lock/subsys/$DAEMON" PIDFILE="/var/run/lvmetad.pid" RETVAL=0 start() { start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root $DAEMON RETVAL=$? return $RETVAL } stop() { stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root $DAEMON RETVAL=$? return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart|condreload) if [ -e "$LOCKFILE" ]; then restart fi ;; status) status --pidfile "$PIDFILE" --expect-user root $DAEMON RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL