Skip to content

Commit

Permalink
Add a verbose argument and some verbosity
Browse files Browse the repository at this point in the history
This allows a user to use "-v|--verbose" to get some insight as to
what could be preventing radosgw from starting properly.

Signed-off-by: David Moreau Simard <[email protected]>
  • Loading branch information
David Moreau Simard committed Nov 5, 2013
1 parent c4b0431 commit bbcddef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
8 changes: 8 additions & 0 deletions doc/radosgw/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ the startup script is trying to start the process as a
``www-data`` or ``apache`` user and an existing ``.asok`` is
preventing the script from starting the daemon.

The radosgw init script (/etc/init.d/radosgw) also has a verbose argument that
can provide some insight as to what could be the issue:

/etc/init.d/radosgw start -v

or

/etc/init.d radosgw start --verbose

HTTP Request Errors
===================
Expand Down
14 changes: 12 additions & 2 deletions src/init-radosgw
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ daemon_is_running() {
fi
}

VERBOSE=0
for opt in $*; do
if [ "$opt" = "-v" ] || [ "$opt" = "--verbose" ]; then
VERBOSE=1
fi
done

# prefix for radosgw instances in ceph.conf
PREFIX='client.radosgw.'

Expand All @@ -31,6 +38,7 @@ DEFAULT_USER='www-data'

RADOSGW=`which radosgw`
if [ ! -x "$RADOSGW" ]; then
[ $VERBOSE -eq 1 ] && echo "$RADOSGW could not start, it is not executable."
exit 1
fi

Expand All @@ -51,7 +59,9 @@ case "$1" in

# mapped to this host?
host=`ceph-conf -n $name host`
if [ "$host" != `hostname -s` ]; then
hostname=`hostname -s`
if [ "$host" != "$hostname" ]; then
[ $VERBOSE -eq 1 ] && echo "hostname $hostname could not be found in ceph.conf:[$name], not starting."
continue
fi

Expand Down Expand Up @@ -86,7 +96,7 @@ case "$1" in
daemon_is_running $RADOSGW
;;
*)
echo "Usage: $0 start|stop|restart|force-reload|reload|status" >&2
echo "Usage: $0 {start|stop|restart|force-reload|reload|status} [-v|--verbose]" >&2
exit 3
;;
esac
Expand Down
14 changes: 12 additions & 2 deletions src/init-radosgw.sysv
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ daemon_is_running() {
fi
}

VERBOSE=0
for opt in $*; do
if [ "$opt" = "-v" ] || [ "$opt" = "--verbose" ]; then
VERBOSE=1
fi
done

# prefix for radosgw instances in ceph.conf
PREFIX='client.radosgw.'

Expand All @@ -33,6 +40,7 @@ DEFAULT_USER='apache'

RADOSGW=`which radosgw`
if [ ! -x "$RADOSGW" ]; then
[ $VERBOSE -eq 1 ] && echo "$RADOSGW could not start, it is not executable."
exit 1
fi

Expand All @@ -54,7 +62,9 @@ case "$1" in

# mapped to this host?
host=`ceph-conf -n $name host`
if [ "$host" != `hostname -s` ]; then
hostname=`hostname -s`
if [ "$host" != "$hostname" ]; then
[ $VERBOSE -eq 1 ] && echo "hostname $hostname could not be found in ceph.conf:[$name], not starting."
continue
fi

Expand Down Expand Up @@ -93,7 +103,7 @@ case "$1" in
daemon_is_running $RADOSGW
;;
*)
echo "Usage: $0 start|stop|restart|force-reload|reload|status" >&2
echo "Usage: $0 {start|stop|restart|force-reload|reload|status} [-v|--verbose]" >&2
exit 3
;;
esac

0 comments on commit bbcddef

Please sign in to comment.