You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/29 05:43:22 UTC
[GitHub] [doris] wolfboys opened a new pull request, #11325: start|stop script files improvement
wolfboys opened a new pull request, #11325:
URL: https://github.com/apache/doris/pull/11325
# Proposed changes
Issue Number: close #xxx
## Problem Summary:
start|stop script files improvement
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [x] I don't know
2. Has unit tests been added:
- [ ] Yes
- [ ] No
- [x] No Need
3. Has document been added or modified:
- [ ] Yes
- [ ] No
- [x] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [x] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes
- [x] No
## Further comments
compatible with the case where the script is a soft link (reference apache tomcat)
optimize script readability
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] adonis0147 commented on a diff in pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
adonis0147 commented on code in PR #11325:
URL: https://github.com/apache/doris/pull/11325#discussion_r934592172
##########
bin/stop_be.sh:
##########
@@ -16,23 +16,26 @@
# specific language governing permissions and limitations
# under the License.
-curdir=$(dirname "$0")
-curdir=$(
- cd "$curdir"
- pwd
-)
+# resolve links - $0 may be a softlink
+PRG="$0"
-export DORIS_HOME=$(
- cd "$curdir/.."
- pwd
-)
-export PID_DIR=$(
- cd "$curdir"
- pwd
-)
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`/"$link"
+ fi
+done
+
+PRGDIR=`dirname "$PRG"`
+
+export DORIS_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
+export PID_DIR=`cd "$PRGDIR" >/dev/null; pwd`
signum=9
-if [ "x"$1 = "x--grace" ]; then
+if [ x"$1" = x"--grace" ]; then
Review Comment:
```suggestion
if [[ "$1" == "--grace" ]]; then
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #11325:
URL: https://github.com/apache/doris/pull/11325#issuecomment-1200164633
please rebase on master since it has merged pr which affects the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #11325:
URL: https://github.com/apache/doris/pull/11325#issuecomment-1198996724
May I ask what is the problem when the script is a soft link?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] wolfboys closed pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
wolfboys closed pull request #11325: [Improvement] start|stop script files improvements
URL: https://github.com/apache/doris/pull/11325
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] adonis0147 commented on a diff in pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
adonis0147 commented on code in PR #11325:
URL: https://github.com/apache/doris/pull/11325#discussion_r934647338
##########
bin/start_be.sh:
##########
@@ -16,11 +16,38 @@
# specific language governing permissions and limitations
# under the License.
-curdir=$(dirname "$0")
-curdir=$(
- cd "$curdir"
- pwd
-)
+#check max_map_count
+MAX_MAP_COUNT=`sysctl -n vm.max_map_count`
Review Comment:
```suggestion
MAX_MAP_COUNT="$(sysctl -n vm.max_map_count)"
```suggestion
It is better to use `$()` rather than ``.
##########
bin/start_be.sh:
##########
@@ -16,11 +16,38 @@
# specific language governing permissions and limitations
# under the License.
-curdir=$(dirname "$0")
-curdir=$(
- cd "$curdir"
- pwd
-)
+#check max_map_count
+MAX_MAP_COUNT=`sysctl -n vm.max_map_count`
+if [ $MAX_MAP_COUNT -lt 2000000 ]; then
Review Comment:
Use `[[]]` to test, otherwise, you should double quote $MAX_MAP_COUNT.
```suggestion
if [[ "${MAX_MAP_COUNT}" -lt 2000000 ]]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] wolfboys closed pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
wolfboys closed pull request #11325: [Improvement] start|stop script files improvements
URL: https://github.com/apache/doris/pull/11325
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] adonis0147 commented on a diff in pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
adonis0147 commented on code in PR #11325:
URL: https://github.com/apache/doris/pull/11325#discussion_r934649137
##########
bin/start_be.sh:
##########
@@ -16,11 +16,38 @@
# specific language governing permissions and limitations
# under the License.
-curdir=$(dirname "$0")
-curdir=$(
- cd "$curdir"
- pwd
-)
+#check max_map_count
+MAX_MAP_COUNT=`sysctl -n vm.max_map_count`
+if [ $MAX_MAP_COUNT -lt 2000000 ]; then
Review Comment:
Use `[[]]` to test, otherwise, you should double quote $MAX_MAP_COUNT.
```suggestion
if [[ "${MAX_MAP_COUNT}" -lt 2000000 ]]; then
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #11325:
URL: https://github.com/apache/doris/pull/11325#issuecomment-1209159194
start_fe may need to rebase on master since it has added the '--version' option.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] wolfboys commented on pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
wolfboys commented on PR #11325:
URL: https://github.com/apache/doris/pull/11325#issuecomment-1199009911
> May I ask what is the problem when the script is a soft link?
see https://github.com/apache/doris/pull/10918
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] adonis0147 commented on a diff in pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
adonis0147 commented on code in PR #11325:
URL: https://github.com/apache/doris/pull/11325#discussion_r934647338
##########
bin/start_be.sh:
##########
@@ -16,11 +16,38 @@
# specific language governing permissions and limitations
# under the License.
-curdir=$(dirname "$0")
-curdir=$(
- cd "$curdir"
- pwd
-)
+#check max_map_count
+MAX_MAP_COUNT=`sysctl -n vm.max_map_count`
Review Comment:
```suggestion
MAX_MAP_COUNT="$(sysctl -n vm.max_map_count)"
```
It is better to use `$()` rather than ``.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #11325:
URL: https://github.com/apache/doris/pull/11325#issuecomment-1199111829
> > May I ask what is the problem when the script is a soft link?
>
> see #10918
Thanks,
I tried your new script and figured that when using 'ln -s bin/start_fe.sh xxx.sh' to make a soft link on another directory and run xxx.sh, it could also work properly. The old script can not work in this situation.
LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] adonis0147 commented on a diff in pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
adonis0147 commented on code in PR #11325:
URL: https://github.com/apache/doris/pull/11325#discussion_r934592172
##########
bin/stop_be.sh:
##########
@@ -16,23 +16,26 @@
# specific language governing permissions and limitations
# under the License.
-curdir=$(dirname "$0")
-curdir=$(
- cd "$curdir"
- pwd
-)
+# resolve links - $0 may be a softlink
+PRG="$0"
-export DORIS_HOME=$(
- cd "$curdir/.."
- pwd
-)
-export PID_DIR=$(
- cd "$curdir"
- pwd
-)
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`/"$link"
+ fi
+done
+
+PRGDIR=`dirname "$PRG"`
+
+export DORIS_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
+export PID_DIR=`cd "$PRGDIR" >/dev/null; pwd`
signum=9
-if [ "x"$1 = "x--grace" ]; then
+if [ x"$1" = x"--grace" ]; then
Review Comment:
```suggestion
if [[ "$1" == "--grace" ]]; then
```
If you use `[[]]` to test it, the prefix `x` can be omitted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #11325: [Improvement] start|stop script files improvements
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #11325:
URL: https://github.com/apache/doris/pull/11325#issuecomment-1209154333
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org