Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > ae089864fd013eaec20f35532d54d5f4 > files > 3

mfs-chunkserver-1.6.20-1.x86_64.rpm

#!/bin/bash
#
# Init file for the MooseFS chunkserver service
#
# chkconfig: - 93 83
#
# description: MooseFS chunkserver
#
# processname: mfschunkserver
# config: @sysconfdir@/mfschunkserver.cfg

# Source function library.
. /etc/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Source initialization configuration.
[ -r "/etc/sysconfig/mfschunkserver" ] && . /etc/sysconfig/mfschunkserver

# Check that networking is up.
[ "${NETWORKING}" == "no" ] && exit 0
[ -x "/usr/sbin/mfschunkserver" ] || exit 1
[ -r "/etc/mfschunkserver.cfg" ] || exit 1
[ -r "/etc/mfshdd.cfg" ] || exit 1

RETVAL=0
prog="mfschunkserver"

start () {
    gprintf "Starting %s: " "$prog"
    daemon $prog >/dev/null 2>&1
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
    return $RETVAL
}

stop () {
    gprintf "Stopping %s: " "$prog"
    $prog stop >/dev/null 2>&1 || killproc $prog >/dev/null 2>&1
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
    return $RETVAL
}

restart () {
    stop
    start
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart|reload)
    restart
    ;;
  condrestart)
    [ -e /var/lock/subsys/$prog ] && restart
    RETVAL=$?
    ;;
  status)
    status $prog
    RETVAL=$?
    ;;
  *)
    gprintf "Usage: %s {start|stop|restart|condrestart|status}\n" "$0"
    RETVAL=1
esac

exit $RETVAL