yahoo / CMAK

CMAK is a tool for managing Apache Kafka clusters
Apache License 2.0
11.84k stars 2.5k forks source link

kafka-manager debian package startup script #73

Open Raboo opened 9 years ago

Raboo commented 9 years ago

Hi, I've just created a debian package with sbt. And it creates /usr/share/kafka-manager/bin/kafka-manager /etc/default/kafka-manager /etc/kafka-manager/application.conf

A sane default would be to add this line to ..../bin/kafka-manager so it reads /etc/default/kafka-manager

#!/usr/bin/env bash

[ -r /etc/default/kafka-manager ] && . /etc/default/kafka-manager

Another sane default would be to add these lines to /etc/default/kafka-manager.

export PIDFILE="/var/run/kafka-manager/play.pid"
export JAVA_OPTS="-Dpidfile.path=$PIDFILE -Dconfig.file=/etc/kafka-manager/application.conf $JAVA_OPTS"
export APPLICATION_SECRET="somekey"
export ZK_HOSTS="zookeeper01:2181,zookeeper02:2181"
Raboo commented 9 years ago

I forgot, it's would also be nice if the package install created system user & group kafka-manager.

nguyenvanthan commented 9 years ago

@Raboo You can create a file in /usr/share/kafka-manager/conf/application.ini to pass the -D parameter ex:

-Dpidfile.path=/path/pid -Dconfig.file={{ KAFKA_MANAGER_HOME }}/conf/application.conf -Dlogback.configurationFile=file:{{ KAFKA_MANAGER_HOME }}/conf/logger.xml -Dhttp.port=9000

it will be use by the script in /etc/init/kafka-manager.conf

dazza-codes commented 7 years ago

On Ubuntu 16.04 (possibly other distros), move from Upstart to Systemd, see e.g.

(Wow this issue is old.)