blob: 3008f0fe4be0b6b3ff213abde6d610de6041766e [file] [log] [blame]
rdudyalab086cf32016-08-11 00:07:45 -04001#
2# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#    http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18description "Kafka"
19
20start on runlevel [2345]
21stop on runlevel [!2345]
22
23respawn
24
25limit nofile 32768 32768
26
27# If zookeeper is running on this box also give it time to start up properly
28pre-start script
29 if [ -e /etc/init.d/zookeeper ]; then
30 /etc/init.d/zookeeper start || true
31 fi
32end script
33
34# Rather than using setuid/setgid sudo is used because the pre-start task must run as root
35exec sudo -Hu kafka -g kafka KAFKA_HEAP_OPTS="-Xmx128m" /opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties