Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variable to skip mysqld start when only initialize data #82

Merged
merged 1 commit into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions percona-server.56/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ Do note that there is no need to use this mechanism to create the `root` superus

Set to `yes` to allow the container to be started with a blank password for the root user. **NOTE:** Setting this variable to `yes` is not recommended unless you really know what you are doing, since this will leave your instance completely unprotected, allowing anyone to gain complete superuser access.

## `MYSQL_INIT_ONLY`

Set to `1` will skip starting the `mysqld` process and will run only the initialization part if MySQL was not initialized before.

# Notes, Tips, Gotchas

## Secure Container Startup
Expand Down
6 changes: 6 additions & 0 deletions percona-server.56/ps-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
echo 'MySQL init process done. Ready for start up.'
echo
fi

# exit when MYSQL_INIT_ONLY environment variable is set to avoid starting mysqld
if [ ! -z "$MYSQL_INIT_ONLY" ]; then
echo 'Initialization complete, now exiting!'
exit 0
fi
fi

exec "$@"
4 changes: 4 additions & 0 deletions percona-server.57/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Set to `1` to allow the container to be started with enabled TOKUDB engine.

Set to `1` to allow the container to be started with enabled ROCKSDB engine.

## `MYSQL_INIT_ONLY`

Set to `1` will skip starting the `mysqld` process and will run only the initialization part if MySQL was not initialized before.

# Notes, Tips, Gotchas

## Secure Container Startup
Expand Down
6 changes: 6 additions & 0 deletions percona-server.57/ps-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
echo 'MySQL init process done. Ready for start up.'
echo
fi

# exit when MYSQL_INIT_ONLY environment variable is set to avoid starting mysqld
if [ ! -z "$MYSQL_INIT_ONLY" ]; then
echo 'Initialization complete, now exiting!'
exit 0
fi
fi

exec "$@"
4 changes: 4 additions & 0 deletions percona-server.80/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Set to `1` to allow the container to be started with enabled TOKUDB engine.

Set to `1` to allow the container to be started with enabled ROCKSDB engine.

## `MYSQL_INIT_ONLY`

Set to `1` will skip starting the `mysqld` process and will run only the initialization part if MySQL was not initialized before.

# Notes, Tips, Gotchas

## Secure Container Startup
Expand Down
6 changes: 6 additions & 0 deletions percona-server.80/ps-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
echo 'MySQL init process done. Ready for start up.'
echo
fi

# exit when MYSQL_INIT_ONLY environment variable is set to avoid starting mysqld
if [ ! -z "$MYSQL_INIT_ONLY" ]; then
echo 'Initialization complete, now exiting!'
exit 0
fi
fi

exec "$@"