glusterfs/.gear/glustereventsd.init
Andrew A. Vasilyev 514ddcb13c 6.2 import
2019-05-31 13:58:12 +03:00

107 lines
1.8 KiB
Bash

#!/bin/sh
#
# glustereventsd glustereventsd server.
#
# chkconfig: - 20 80
# description: This file starts / stops the gluster events server
# processname: glustereventsd
# pidfile: /var/run/glustereventsd.pid
### BEGIN INIT INFO
# Provides: glustereventsd
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: glusterfs Events server
# Description: GlusterFS Events Server
### END INIT INFO
#
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
NAME=glustereventsd
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
LOCKFILE=/var/lock/subsys/$NAME
SourceIfNotEmpty /etc/sysconfig/$NAME
GLUSTEREVENTSD_OPTS="--pid-file -p $PIDFILE"
RETVAL=0
start()
{
[ -x $exec ] || exit 5
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $DAEMON $GLUSTEREVENTSD_OPTS
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $NAME
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
msg_reloading $NAME
stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- $NAME
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload|force-reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart|try-restart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root -- $NAME
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL