forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-dev.sh
executable file
·26 lines (25 loc) · 1.11 KB
/
setup-dev.sh
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
#!/bin/bash
ln -sf /opt/kazoo/core/priv/sup /usr/bin/sup
ln -s /opt/kazoo/scripts/rabbitmq-server.init /etc/init.d/rabbitmq-server
ln -s /opt/kazoo/scripts/kz-generic.init /etc/init.d/kz-ecallmgr
ln -s /opt/kazoo/scripts/kz-generic.init /etc/init.d/kz-kazoo_apps
ln -s /opt/kazoo/scripts/rabbitmq-generic.sh /usr/bin/rabbitmq-server
ln -s /opt/kazoo/scripts/rabbitmq-generic.sh /usr/bin/rabbitmq-plugins
ln -s /opt/kazoo/scripts/rabbitmq-generic.sh /usr/bin/rabbitmqctl
rm -rf /var/lib/rabbitmq /var/log/rabbitmq /usr/lib/rabbitmq
mkdir -p /var/lib/rabbitmq
chown rabbitmq:daemon /var/lib/rabbitmq
ln -sfn /opt/kazoo/deps/rabbitmq_server-3.1.3/scripts /var/lib/rabbitmq/bin
chmod +x /etc/init.d/rabbitmq*
chmod +x /etc/init.d/kz-*
chmod +x /usr/bin/rabbitmq*
if ! getent passwd kazoo >/dev/null 2>&1; then
useradd -r -g daemon -M -d /opt/kazoo -s /sbin/nologin kazoo
else
usermod -g daemon -d /opt/kazoo -s /sbin/nologin kazoo
fi
if ! getent passwd rabbitmq >/dev/null 2>&1; then
useradd -r -g daemon -M -d /var/lib/rabbitmq -s /sbin/nologin rabbitmq
else
usermod -g daemon -d /var/lib/rabbitmq -s /sbin/nologin rabbitmq
fi