summarylogtreecommitdiffstats
path: root/install_confluent.sh
blob: 614c35444540f2a326824fc9c17792a5f1efe33f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
user_list="cp-control-center cp-kafka-connect cp-kafka-rest cp-kafka cp-ksql cp-schema-registry cp-install_kafka"
group=confluent

ensure_directories() {
	# Configure Apache kafka 
	for dir in /var/log/confluent/kafka /var/lib/confluent/kafka /var/lib/confluent/zookeeper /var/log/kafka; do
		install -g confluent -o cp-kafka -m 0755 -d ${pkgdir}/$dir
	done

	# Required directories for Confluent Control Center 
	for dir in /var/log/confluent/control-center /var/lib/confluent/control-center /usr/share/confluent-control-center; do
		install -g confluent -o cp-control-center -m 0755 -d ${pkgdir}/$dir
	done

	# Required directories for Confluent Schema Registry
	for dir in /var/log/confluent/schema-registry; do
		install -g confluent -o cp-schema-registry -m 0755 -d ${pkgdir}/$dir
	done
}

post_install() {
	systemd-sysusers confluent.conf
	ensure_directories
}

post_upgrade(){
	systemd-sysusers confluent.conf
	ensure_directories
}

post_remove() {
	for usr in `echo $user_list`; do
		if getent passwd $usr >/dev/null 2>&1; then
			userdel -f $usr
		fi
	done

	groupdel $group
}