File: customDockerInit.sh

package info (click to toggle)
toil 9.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,908 kB
  • sloc: python: 58,029; makefile: 313; sh: 168
file content (16 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
# Runs custom initialization before running the main docker service.
# The first argument is a single string containing the custom init command.
# The second argument is the docker service binary (e.g. mesos-slave).
# The rest of the arguments are passed into the service.
# All arguments are required!
#
# Example usage:
# $ customDockerInit.sh 'echo "hello world"' mesos-slave --log_dir=/var/lib/mesos ...

CUSTOM_INIT_COMMAND="${1}"
SERVICE_COMMAND="${2}"
SERVICE_COMMAND_ARGS="${@:3}"

bash -c "${CUSTOM_INIT_COMMAND}"
eval "${SERVICE_COMMAND}" "${SERVICE_COMMAND_ARGS}"