From 080beba063b05b184d7befcb15a8bcf32e7424f6 Mon Sep 17 00:00:00 2001
From: Olga Arkhangelskaia <arkholga@tarantool.org>
Date: Wed, 29 Apr 2020 14:36:34 +0300
Subject: [PATCH] build: don't start example instance in postinstall

After tarantool installation on Debian/Ubuntu from repo, example
instance was automatically started on 3301 port. At the same time
example instance on RHEL/CentOS is started manually. Patch does the same
for Debian/Ubuntu.

Closes #4507

Reviewed-by: Igor Munkin <imun@tarantool.org>
Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
---
 debian/tarantool-common.postinst  | 8 --------
 extra/dist/tarantool-generator.in | 1 +
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/debian/tarantool-common.postinst b/debian/tarantool-common.postinst
index e2eda34158..03e4b22157 100644
--- a/debian/tarantool-common.postinst
+++ b/debian/tarantool-common.postinst
@@ -22,14 +22,6 @@ case "$1" in
         install -d -o$SYSUSER -gadm -m2750 /var/log/tarantool
         install -d -o$SYSUSER -g$SYSUSER -m750 /var/run/tarantool
         install -d -o$SYSUSER -g$SYSUSER -m750 /var/lib/tarantool
-
-        # Enable example.lua by default
-        if [ -z $2 ] && [ ! -e /etc/tarantool/instances.enabled/example.lua ] &&
-           [ -d /etc/tarantool/instances.enabled ] &&
-           [ -d /etc/tarantool/instances.available/ ]; then
-          ln -s /etc/tarantool/instances.available/example.lua \
-                /etc/tarantool/instances.enabled/example.lua
-        fi
     ;;
 esac
 
diff --git a/extra/dist/tarantool-generator.in b/extra/dist/tarantool-generator.in
index f6a6a2540d..2048b75177 100755
--- a/extra/dist/tarantool-generator.in
+++ b/extra/dist/tarantool-generator.in
@@ -13,6 +13,7 @@ mkdir -p "$wantdir"
 
 for file in @TARANTOOL_ENABLEDDIR@/*.lua; do
 	instance=`basename $file .lua`
+	[ "${instance}" = "*" ] && break  # skip empty directory
 	ln -s "$service" "$wantdir/tarantool@$instance.service"
 done
 
-- 
GitLab