-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Examples: only terminate vtadmin if it was started (#13433)
* Do not error stopping vtadmin web and api if pidd files do not exist. For fixing below. #13432 Signed-off-by: Jean-François Gagné <jfg956@users.noreply.github.com> * Get rid of code duplication in vtadmin-down.sh. Signed-off-by: Jean-François Gagné <jfg956@users.noreply.github.com> * Use bash test Signed-off-by: Matt Lord <mattalord@gmail.com> * Use SIGTERM and wait for process to end Signed-off-by: Matt Lord <mattalord@gmail.com> * Validate function parameters Signed-off-by: Matt Lord <mattalord@gmail.com> * Add license header Signed-off-by: Matt Lord <mattalord@gmail.com> * Move vtadmin stop function to utils Signed-off-by: Matt Lord <mattalord@gmail.com> * Generalize simple process shutdown with timeout Signed-off-by: Matt Lord <mattalord@gmail.com> * Correct output Signed-off-by: Matt Lord <mattalord@gmail.com> * Remove now redundant log message Signed-off-by: Matt Lord <mattalord@gmail.com> * Corrections Signed-off-by: Matt Lord <mattalord@gmail.com> * Add missing license header to modified file Signed-off-by: Matt Lord <mattalord@gmail.com> * Only check PID if we killed it Signed-off-by: Matt Lord <mattalord@gmail.com> * Remove mix of spaces and tabs Signed-off-by: Matt Lord <mattalord@gmail.com> --------- Signed-off-by: Jean-François Gagné <jfg956@users.noreply.github.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: Matt Lord <mattalord@gmail.com>
- Loading branch information
Showing
8 changed files
with
74 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
#!/bin/bash | ||
|
||
source "$(dirname "${BASH_SOURCE[0]:-$0}")/../env.sh" | ||
# Copyright 2023 The Vitess Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
echo "Stopping vtadmin-web..." | ||
kill -9 "$(cat "$VTDATAROOT/tmp/vtadmin-web.pid")" | ||
source "$(dirname "${BASH_SOURCE[0]:-$0}")/../env.sh" | ||
|
||
echo "Stopping vtadmin-api..." | ||
kill -9 "$(cat "$VTDATAROOT/tmp/vtadmin-api.pid")" | ||
stop_process "vtadmin-web" "$VTDATAROOT/tmp/vtadmin-web.pid" | ||
stop_process "vtadmin-api" "$VTDATAROOT/tmp/vtadmin-api.pid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 The Vitess Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
source "$(dirname "${BASH_SOURCE[0]:-$0}")/../env.sh" | ||
|
||
echo "Stopping vtorc." | ||
kill -9 "$(cat "$VTDATAROOT/tmp/vtorc.pid")" | ||
stop_process "vtorc" "$VTDATAROOT/tmp/vtorc.pid" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters