You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/14 12:25:59 UTC

[GitHub] [skywalking-satellite] kezhenxu94 commented on a change in pull request #26: add start up script

kezhenxu94 commented on a change in pull request #26:
URL: https://github.com/apache/skywalking-satellite/pull/26#discussion_r575800567



##########
File path: dist/bin/startup.sh
##########
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+
+HOME_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)"
+BIN_DIR=${HOME_DIR}/bin
+LOG_DIR=${HOME_DIR}/logs
+CONFIG_DIR=${HOME_DIR}/configs
+LOG_FILE_LOCATION=${LOG_DIR}/satellite.log
+
+if [ ! -d "${LOG_DIR}" ]; then
+    mkdir -p "${LOG_DIR}"
+fi
+
+if uname -s | grep Darwin; then
+  START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*darwin*")
+elif uname -s | grep Linux; then
+  START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*linux*")
+else
+  echo "Sorry, the official startup process does not support your system."

Review comment:
       You can use `START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*windows*")` here, Windows users can still use this shell script if they use something like Git Bash or Cygwin, otherwise this line of code will never be reached IMO, because Powershell or Command Prompt won't execute `.sh` file at all

##########
File path: dist/bin/startup.sh
##########
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+
+HOME_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)"
+BIN_DIR=${HOME_DIR}/bin
+LOG_DIR=${HOME_DIR}/logs
+CONFIG_DIR=${HOME_DIR}/configs
+LOG_FILE_LOCATION=${LOG_DIR}/satellite.log
+
+if [ ! -d "${LOG_DIR}" ]; then
+    mkdir -p "${LOG_DIR}"
+fi
+
+if uname -s | grep Darwin; then
+  START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*darwin*")
+elif uname -s | grep Linux; then
+  START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*linux*")
+else
+  echo "Sorry, the official startup process does not support your system."
+  exit 1
+fi
+
+eval exec "$START_UP_PROCESS" start --config="$CONFIG_DIR"/satellite_config.yaml 1> "$LOG_FILE_LOCATION" 2>&1 &
+
+if [ $? -eq 0 ]; then
+  sleep 1
+	echo "SkyWalking Satellite started successfully!"

Review comment:
       ```suggestion
     echo "SkyWalking Satellite started successfully!"
   ```

##########
File path: dist/bin/startup.sh
##########
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+
+HOME_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)"
+BIN_DIR=${HOME_DIR}/bin
+LOG_DIR=${HOME_DIR}/logs
+CONFIG_DIR=${HOME_DIR}/configs
+LOG_FILE_LOCATION=${LOG_DIR}/satellite.log
+
+if [ ! -d "${LOG_DIR}" ]; then
+    mkdir -p "${LOG_DIR}"
+fi
+
+if uname -s | grep Darwin; then
+  START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*darwin*")
+elif uname -s | grep Linux; then
+  START_UP_PROCESS=$(find "$BIN_DIR" -name "skywalking-satellite*linux*")
+else
+  echo "Sorry, the official startup process does not support your system."
+  exit 1
+fi
+
+eval exec "$START_UP_PROCESS" start --config="$CONFIG_DIR"/satellite_config.yaml 1> "$LOG_FILE_LOCATION" 2>&1 &
+
+if [ $? -eq 0 ]; then
+  sleep 1
+	echo "SkyWalking Satellite started successfully!"
+else
+	echo "SkyWalking Satellite started failure!"
+	exit 1

Review comment:
       ```suggestion
     echo "SkyWalking Satellite started failure!"
     exit 1
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org