Jason918 commented on code in PR #15449:
URL: https://github.com/apache/pulsar/pull/15449#discussion_r869814510


##########
bin/pulsar-daemon:
##########
@@ -213,7 +215,13 @@ stop ()
     fi
 }
 
-mkdir -p "$PULSAR_LOG_DIR"
+if [ ! -d "$PULSAR_LOG_DIR" ]; then

Review Comment:
   [Minor] `mkdir -p` can handle the case when directory already exists.



##########
conf/bkenv.sh:
##########
@@ -49,10 +49,21 @@ fi
 
 # java version has space, use [[ -n $PARAM ]] to judge if variable exists
 if [[ -n $IS_JAVA_8 ]]; then
-  
BOOKIE_GC_LOG=${BOOKIE_GC_LOG:-${PULSAR_GC_LOG:-"-Xloggc:logs/pulsar_bookie_gc_%p.log
 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation 
-XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M"}}
+  if [ -z "$BOOKIE_LOG_DIR" ]
+  then
+    
BOOKIE_GC_LOG=${BOOKIE_GC_LOG:-${PULSAR_GC_LOG:-"-Xloggc:logs/pulsar_bookie_gc_%p.log
 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation 
-XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M"}}

Review Comment:
   Too many duplicated stuff.
   Can we just set `BOOKIE_LOG_DIR` to "logs" if it does not exists?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to