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 --daemon option to start script #642

Merged
merged 1 commit into from
Feb 20, 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
23 changes: 22 additions & 1 deletion bin/start_be.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@
curdir=`dirname "$0"`
curdir=`cd "$curdir"; pwd`

OPTS=$(getopt \
-n $0 \
-o '' \
-l 'daemon' \
-- "$@")

eval set -- "$OPTS"

RUN_DAEMON=0
while true; do
case "$1" in
--daemon) RUN_DAEMON=1 ; shift ;;
--) shift ; break ;;
*) ehco "Internal error" ; exit 1 ;;
esac
done

export DORIS_HOME=`cd "$curdir/.."; pwd`

# export env variables from be.conf
Expand Down Expand Up @@ -72,4 +89,8 @@ else
LIMIT="/bin/limit3 -c 0 -n 65536"
fi

nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 </dev/null &
if [ ${RUN_DAEMON} -eq 1 ]; then
nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 </dev/null &
else
$LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 </dev/null
fi
32 changes: 31 additions & 1 deletion bin/start_fe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@
curdir=`dirname "$0"`
curdir=`cd "$curdir"; pwd`

OPTS=$(getopt \
-n $0 \
-o '' \
-l 'daemon' \
-l 'helper:' \
-- "$@")

eval set -- "$OPTS"

RUN_DAEMON=0
HELPER=
while true; do
case "$1" in
--daemon) RUN_DAEMON=1 ; shift ;;
--helper) HELPER=$2 ; shift 2 ;;
--) shift ; break ;;
*) ehco "Internal error" ; exit 1 ;;
esac
done

export DORIS_HOME=`cd "$curdir/.."; pwd`

# export env variables from fe.conf
Expand Down Expand Up @@ -75,6 +95,16 @@ else
fi

echo `date` >> $LOG_DIR/fe.out
nohup $LIMIT $JAVA $JAVA_OPTS org.apache.doris.PaloFe "$@" >> $LOG_DIR/fe.out 2>&1 </dev/null &

if [ x"$HELPER" != x"" ]; then
# change it to '-helper' to be compatible with code in Frontend
HELPER="-helper $HELPER"
fi

if [ ${RUN_DAEMON} -eq 1 ]; then
nohup $LIMIT $JAVA $JAVA_OPTS org.apache.doris.PaloFe ${HELPER} "$@" >> $LOG_DIR/fe.out 2>&1 </dev/null &
else
$LIMIT $JAVA $JAVA_OPTS org.apache.doris.PaloFe ${HELPER} "$@" >> $LOG_DIR/fe.out 2>&1 </dev/null
fi

echo $! > $pidfile
24 changes: 23 additions & 1 deletion fs_brokers/apache_hdfs_broker/bin/start_broker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@
curdir=`dirname "$0"`
curdir=`cd "$curdir"; pwd`

OPTS=$(getopt \
-n $0 \
-o '' \
-l 'daemon' \
-- "$@")

eval set -- "$OPTS"

RUN_DAEMON=0
while true; do
case "$1" in
--daemon) RUN_DAEMON=1 ; shift ;;
--) shift ; break ;;
*) ehco "Internal error" ; exit 1 ;;
esac
done

export BROKER_HOME=`cd "$curdir/.."; pwd`
export PID_DIR=`cd "$curdir"; pwd`

Expand Down Expand Up @@ -61,6 +78,11 @@ if [ ! -d $BROKER_LOG_DIR ]; then
fi

echo `date` >> $BROKER_LOG_DIR/apache_hdfs_broker.out
nohup $LIMIT $JAVA $JAVA_OPTS org.apache.doris.broker.hdfs.BrokerBootstrap "$@" >> $BROKER_LOG_DIR/apache_hdfs_broker.out 2>&1 </dev/null &

if [ ${RUN_DAEMON} -eq 1 ]; then
nohup $LIMIT $JAVA $JAVA_OPTS org.apache.doris.broker.hdfs.BrokerBootstrap "$@" >> $BROKER_LOG_DIR/apache_hdfs_broker.out 2>&1 </dev/null &
else
$LIMIT $JAVA $JAVA_OPTS org.apache.doris.broker.hdfs.BrokerBootstrap "$@" >> $BROKER_LOG_DIR/apache_hdfs_broker.out 2>&1 </dev/null
fi

echo $! > $pidfile