From: David Moreau Simard Date: Tue, 5 Nov 2013 17:02:47 +0000 (-0500) Subject: Add a verbose argument and some verbosity X-Git-Tag: v0.73~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbcddef877d737df54565c46778e55bd6de9a6df;p=ceph.git Add a verbose argument and some verbosity 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 --- diff --git a/doc/radosgw/troubleshooting.rst b/doc/radosgw/troubleshooting.rst index 9c63742cb971..918d0a30a5fa 100644 --- a/doc/radosgw/troubleshooting.rst +++ b/doc/radosgw/troubleshooting.rst @@ -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 =================== diff --git a/src/init-radosgw b/src/init-radosgw index d3e2633e41c1..caa05cb5cc4d 100644 --- a/src/init-radosgw +++ b/src/init-radosgw @@ -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.' @@ -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 @@ -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 @@ -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 diff --git a/src/init-radosgw.sysv b/src/init-radosgw.sysv index d3015b284252..869cc18e7dae 100644 --- a/src/init-radosgw.sysv +++ b/src/init-radosgw.sysv @@ -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.' @@ -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 @@ -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 @@ -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