mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-24 18:41:55 +00:00
051d79727b
sysvinit lsb function is 'status_of_proc'
67 lines
1.0 KiB
Bash
Executable File
67 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
# IBM(c) 2014 Apache 2.0
|
|
# chkconfig: 345 85 60
|
|
# description: Confluent hardware manager
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: confluent
|
|
# Default-Start: 3 4 5
|
|
# Default-Stop: 0 1 2 6
|
|
### END INIT INFO
|
|
if [ -f /etc/init.d/functions ]; then
|
|
. /etc/init.d/functions
|
|
LOG_SUCCESS=success
|
|
LOG_FAILURE=failure
|
|
elif [ -f /lib/lsb/init-functions ]; then
|
|
. /lib/lsb/init-functions
|
|
LOG_SUCCESS=log_success_msg
|
|
LOG_FAILURE=log_failure_msg
|
|
else
|
|
echo "Unknown platform"
|
|
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
|
|
if [ $? -eq 0 ]; then
|
|
$LOG_SUCCESS
|
|
echo
|
|
return 0
|
|
else
|
|
$LOG_FAILURE
|
|
echo
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
case $1 in
|
|
restart)
|
|
stop
|
|
start
|
|
;;
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
status)
|
|
status_of_proc -p /var/run/confluent/pid $confluent
|
|
;;
|
|
esac
|
|
|