2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Implemented functions for start() and stop(). The restart case will

call the stop() and start() functions.

Impemented the status case so that 'service confluent status' will
return the state of confluent daemon.
This commit is contained in:
Victor Hu 2015-05-18 14:00:35 -04:00
parent 6a1da9e84f
commit 6ab1ae0c38

View File

@ -19,27 +19,40 @@ else
exit 1
fi
confluent=/opt/confluent/bin/confluent
confetty=/opt/confluent/bin/confetty
stop() {
echo -n 'Stopping Confluent: '
if [ -S /var/run/confluent/api.sock ]; then
$confetty shutdown /
fi
$LOG_SUCCESS
echo
return
}
start() {
echo -n 'Starting Confluent: '
$confluent
$LOG_SUCCESS
echo
return
}
case $1 in
restart)
if [ -S /var/run/confluent/api.sock ]; then
echo -n 'Stopping Confluent '
/opt/confluent/bin/confetty shutdown /
fi
echo -n 'Starting Confluent '
/opt/confluent/bin/confluent
$LOG_SUCCESS
stop
start
;;
start)
echo -n 'Starting Confluent '
/opt/confluent/bin/confluent
$LOG_SUCCESS
start
;;
stop)
echo -n 'Stopping Confluent '
if [ -S /var/run/confluent/api.sock ]; then
/opt/confluent/bin/confetty shutdown /
fi
$LOG_SUCCESS
stop
;;
status)
status -p /var/run/confluent/pid $confluent
;;
esac