/etc/init.d/tarantool is in tarantool-common 1.6.7.588.g76bbd9c-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | #! /bin/sh
# /etc/init.d/tarantool
### BEGIN INIT INFO
# Provides: tarantool
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Tarantool init script
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
# Author: Dmitry E. Oboukhov <unera@debian.org>
PATH=/sbin:/usr/sbin:/bin:/usr/bin:bin
SCRIPTNAME=/etc/init.d/tarantool
DAEMON=/usr/bin/tarantool
DIST_LUA=/usr/bin/tarantoolctl
if [ -e "/lib/lsb/init-functions" ]; then
. /lib/lsb/init-functions
fi
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
if [ -e "/lib/init/vars.sh" ]; then
. /lib/init/vars.sh
elif [ -e "/etc/rc.d/init.d/functions" ]; then
. /etc/rc.d/init.d/functions
fi
if [ -e "/etc/sysconfig/tarantool" ]; then
sysconfig_tarantool="/etc/sysconfig/tarantool"
elif [ -e "/etc/default/tarantool" ]; then
sysconfig_tarantool="/etc/default/tarantool"
fi
if [ -n "$sysconfig_tarantool" ]; then
CONF_DIR=`echo "dofile('$sysconfig_tarantool') print(instance_dir)" | tarantool`
fi
if [ -z "$sysconfig_tarantool" -o "$CONF_DIR" = "nil" ]; then
CONF_DIR="/etc/tarantool/instances.enabled"
fi
INSTANCES=`find $CONF_DIR -xtype f -name '*lua'`
if test -z "$INSTANCES"; then
echo "tarantool: There are no instances (*.lua) in $CONF_DIR"
exit 0
fi
#
# Function that starts the daemon/service
#
do_start() {
echo "tarantool: Starting instances"
for inst in $INSTANCES; do
$DAEMON $DIST_LUA start `basename $inst .lua`
done
return 0
}
#
# Function that stops the daemon/service
#
do_stop() {
echo "tarantool: Stopping instances"
for inst in $INSTANCES; do
$DAEMON $DIST_LUA stop `basename $inst .lua`
done
return 0
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
do_stop
do_start
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
status)
;;
restart|force-reload)
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
|