mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
- make cowboy correctly parse target URI that has method in uppercase;
- sbin/leofs script improvements: on start wait for a node to begin responding to ping, white-space cleanup; - rc script cleanup.
This commit is contained in:
parent
eb9f4ce133
commit
c54c93b42c
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363753
4 changed files with 76 additions and 43 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
PORTNAME= leofs
|
PORTNAME= leofs
|
||||||
PORTVERSION= 1.0.2
|
PORTVERSION= 1.0.2
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= databases
|
CATEGORIES= databases
|
||||||
|
|
||||||
MAINTAINER= trociny@FreeBSD.org
|
MAINTAINER= trociny@FreeBSD.org
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# leofs_servers (list): Specify servers to run as a space separated
|
# leofs_servers (list): Specify servers to run as a space separated
|
||||||
# list of possible values:
|
# list of possible values:
|
||||||
# gateway,
|
# gateway,
|
||||||
# manager_master,
|
# manager,
|
||||||
# manager_slave,
|
# manager_slave,
|
||||||
# storage.
|
# storage.
|
||||||
# The aliase ALL may be used to run all servers.
|
# The aliase ALL may be used to run all servers.
|
||||||
|
@ -53,7 +53,7 @@ leofs_start()
|
||||||
local s
|
local s
|
||||||
|
|
||||||
for s in ${leofs_servers}; do
|
for s in ${leofs_servers}; do
|
||||||
echo -n "Starting ${s}... "
|
echo -n "Starting leofs ${s}... "
|
||||||
%%PREFIX%%/sbin/leofs ${s} start
|
%%PREFIX%%/sbin/leofs ${s} start
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
echo "done."
|
echo "done."
|
||||||
|
@ -70,7 +70,7 @@ leofs_stop()
|
||||||
local status=0
|
local status=0
|
||||||
|
|
||||||
for s in ${leofs_servers}; do
|
for s in ${leofs_servers}; do
|
||||||
echo -n "Stopping ${s}... "
|
echo -n "Stopping leofs ${s}... "
|
||||||
%%PREFIX%%/sbin/leofs ${s} stop
|
%%PREFIX%%/sbin/leofs ${s} stop
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
echo "done."
|
echo "done."
|
||||||
|
@ -89,10 +89,10 @@ leofs_status()
|
||||||
for s in ${leofs_servers}; do
|
for s in ${leofs_servers}; do
|
||||||
%%PREFIX%%/sbin/leofs ${s} ping > /dev/null 2>&1
|
%%PREFIX%%/sbin/leofs ${s} ping > /dev/null 2>&1
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "${s} is not running."
|
echo "leofs ${s} is not running."
|
||||||
status=1
|
status=1
|
||||||
else
|
else
|
||||||
echo "${s} is running."
|
echo "leofs ${s} is running."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ for s in ${leofs_servers}; do
|
||||||
gateway|manager|manager_slave|storage)
|
gateway|manager|manager_slave|storage)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
warn "unknown leo server: ${s}"
|
warn "unknown leofs server: ${s}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
Make cowboy correctly parse target URI that has method in uppercase.
|
||||||
|
|
||||||
|
--- deps/cowboy/src/cowboy_protocol.erl.orig 2013-06-20 19:44:36.000000000 +0300
|
||||||
|
+++ deps/cowboy/src/cowboy_protocol.erl 2014-07-31 23:10:11.000000000 +0300
|
||||||
|
@@ -214,8 +214,12 @@
|
||||||
|
parse_version(Rest, State, Method, <<"*">>, <<>>);
|
||||||
|
parse_uri(<< "http://", Rest/bits >>, State, Method) ->
|
||||||
|
parse_uri_skip_host(Rest, State, Method);
|
||||||
|
+parse_uri(<< "HTTP://", Rest/bits >>, State, Method) ->
|
||||||
|
+ parse_uri_skip_host(Rest, State, Method);
|
||||||
|
parse_uri(<< "https://", Rest/bits >>, State, Method) ->
|
||||||
|
parse_uri_skip_host(Rest, State, Method);
|
||||||
|
+parse_uri(<< "HTTPS://", Rest/bits >>, State, Method) ->
|
||||||
|
+ parse_uri_skip_host(Rest, State, Method);
|
||||||
|
parse_uri(Buffer, State, Method) ->
|
||||||
|
parse_uri_path(Buffer, State, Method, <<>>).
|
||||||
|
|
|
@ -558,6 +558,8 @@ register_cmd restart
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
cmd_start()
|
cmd_start()
|
||||||
{
|
{
|
||||||
|
local i res
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help_summary)
|
help_summary)
|
||||||
echo "Launch the application"
|
echo "Launch the application"
|
||||||
|
@ -578,6 +580,20 @@ cmd_start()
|
||||||
|
|
||||||
${ERTS_PATH}/run_erl -daemon ${LEOFS_PIPE} ${LEOFS_LOGDIR} \
|
${ERTS_PATH}/run_erl -daemon ${LEOFS_PIPE} ${LEOFS_LOGDIR} \
|
||||||
"exec ${PROGPATH} ${LEOFS_SERVER} console $@" 2>&1
|
"exec ${PROGPATH} ${LEOFS_SERVER} console $@" 2>&1
|
||||||
|
res=$?
|
||||||
|
|
||||||
|
if [ "${res}" -ne 0 ]
|
||||||
|
then
|
||||||
|
exit ${res}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wait up to 1 minute for the node to start responding on ping.
|
||||||
|
for i in `jot 60`
|
||||||
|
do
|
||||||
|
nodetool ping >/dev/null 2>&1 || exit 0
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
register_cmd start
|
register_cmd start
|
||||||
|
|
Loading…
Add table
Reference in a new issue