File: start_tdb.sh.in

package info (click to toggle)
tango 10.0.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 89,936 kB
  • sloc: cpp: 201,786; sh: 1,645; python: 953; java: 800; perl: 467; javascript: 447; xml: 325; makefile: 272; sql: 72; ruby: 24
file content (24 lines) | stat: -rwxr-xr-x 684 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

set -e

mysql --user @MYSQL_ADMIN@ --password=@MYSQL_ADMIN_PASSWD@ --batch -e "DROP DATABASE @TANGO_DB_NAME@;" || true
mysql --user @MYSQL_ADMIN@ --password=@MYSQL_ADMIN_PASSWD@ --batch -e "source create_db.sql;"

rm -f tdb_output.log

(
  # Heavily inspired by https://gitlab.com/tango-controls/cppTango/-/blob/main/cpp_test_suite/environment/start_server.sh.cmake
  export MYSQL_USER=@MYSQL_ADMIN@
  export MYSQL_PASSWORD=@MYSQL_ADMIN_PASSWD@

  server_pid="$(sh -c 'printf $PPID')"
  echo $server_pid > tdb.pid

  exec 1<&-
  exec 2<&-
  exec 1<> tdb_output.log
  exec 2>&1
  exec ./Databaseds 2 -v5 -ORBendPoint giop:tcp:127.0.0.1:10000
) &
echo $! > tdb.pid