Closed ollofx closed 3 years ago
the only issue is that service stop could wait forever
elasticsearch replace forever/TERM/20 instead of TERM/60/KILL/5 for instance /etc/init.d/kibana
/etc/init.d/eleaticsearch
log_daemon_msg "Stopping $DESC"
if [ -f "$PID_FILE" ]; then
start-stop-daemon --stop --pidfile "$PID_FILE" \
--user "$ES_USER" \
--quiet \
--retry TERM/60/KILL/5 > /dev/null
if [ $? -eq 1 ]; then
log_progress_msg "$DESC is not running but pid file exists, cleaning up"
elif [ $? -eq 3 ]; then
PID="`cat $PID_FILE`"
log_failure_msg "Failed to stop $DESC (pid $PID)"
exit 1
fi
rm -f "$PID_FILE"
Great suggestion, thanks @ollofx!
initiate stop service at the same time for all services then disable signal trap and wait for service stop to complete
start.sh:16