rdudyala | b086cf3 | 2016-08-11 00:07:45 -0400 | [diff] [blame] | 1 | # |
| 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 | |
| 18 | description "Kafka" |
| 19 | |
| 20 | start on runlevel [2345] |
| 21 | stop on runlevel [!2345] |
| 22 | |
| 23 | respawn |
| 24 | |
| 25 | limit nofile 32768 32768 |
| 26 | |
| 27 | # If zookeeper is running on this box also give it time to start up properly |
| 28 | pre-start script |
| 29 | if [ -e /etc/init.d/zookeeper ]; then |
| 30 | /etc/init.d/zookeeper start || true |
| 31 | fi |
| 32 | end script |
| 33 | |
| 34 | # Rather than using setuid/setgid sudo is used because the pre-start task must run as root |
| 35 | exec sudo -Hu kafka -g kafka KAFKA_HEAP_OPTS="-Xmx128m" /opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties |