[iwhd] make --auto (-a) use mongod's --nojournal option when possible, ...
by Jim Meyering
commit 094393b8585011ee0afb73db1370fb6bedd86db9
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Feb 28 13:48:21 2012 +0100
make --auto (-a) use mongod's --nojournal option when possible, ...
so that we don't have to endure the long journal-initialization delay.
This avoids the failure of the t/auto test on systems where mongod
is configured to use a journal.
* configure.ac: Test whether mongod accepts the --nojournal option.
(MONGOD_NO_JOURNAL): Set/define new variable.
* auto.c (auto_arg_mongod, auto_arg_mongod_quiet): Use it.
auto.c | 2 ++
configure.ac | 9 +++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/auto.c b/auto.c
index 64f6a9a..3f0e827 100644
--- a/auto.c
+++ b/auto.c
@@ -27,6 +27,7 @@ static char auto_arg_port[10];
static const char *const auto_arg_mongod[] = {
"mongod",
+ MONGOD_NO_JOURNAL
"--port", auto_arg_port,
"--dbpath", AUTO_DIR_DB,
/* "--fork", */ /* chdirs god knows where, we cannot use this. */
@@ -39,6 +40,7 @@ static const char *const auto_arg_mongod[] = {
/* The --quiet option in mongod is useless, so redirect instead. */
static const char *const auto_arg_mongod_quiet[] = {
"mongod",
+ MONGOD_NO_JOURNAL
"--port", auto_arg_port,
"--dbpath", AUTO_DIR_DB,
"--logpath", AUTO_MONGOD_LOG,
diff --git a/configure.ac b/configure.ac
index ad9d53d..07e4dc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,6 +90,15 @@ AC_CHECK_HEADER([mongo/client/dbclient.h], ,
[#undef VERSION])
AC_LANG_POP
+# If mongod supports the --nojournal option, use it.
+case `exec 2>/dev/null; mongod --help` in
+ *--nojournal*) MONGOD_NO_JOURNAL='"--nojournal",';;
+ *) MONGOD_NO_JOURNAL='/* empty */';;
+esac
+AC_DEFINE_UNQUOTED([MONGOD_NO_JOURNAL], [$MONGOD_NO_JOURNAL],
+ [Define to '"--nojournal",' or to a comment;
+ to be used when invoking mongod via iwhd -a.])
+
# Starting in jansson 2.1, file-loading functions require an
# additional "flags" argument. Test for this.
AC_CACHE_CHECK([whether json_load_file takes 3 arguments],
12 years, 2 months
[iwhd] iwhd --auto: increase timeout to allow for longer mongod start-up delay
by Jim Meyering
commit e8f2241524137230e22d445732ea79484dd6cd83
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Feb 24 17:41:25 2012 +0100
iwhd --auto: increase timeout to allow for longer mongod start-up delay
These changes avoid the failure of the t/auto test when run via
"make -j$N check" for nontrivial $N.
* auto.c (auto_wait_mongod): Increase timeout from 20s to 30s,
to accommodate longer delay required for mongod to start, in case it
performs journal initialization, as is now the default in Fedora 16.
* t/auto: Likewise.
auto.c | 2 +-
t/auto | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/auto.c b/auto.c
index cd54d88..64f6a9a 100644
--- a/auto.c
+++ b/auto.c
@@ -184,7 +184,7 @@ auto_wait_mongod(void)
rc = auto_test_mongod();
if (rc == 0)
break;
- if (time(NULL) >= start_time + 20) {
+ if (time(NULL) >= start_time + 30) {
log_msg(0, _("failed to verify mongod using port %s"),
auto_arg_port);
return -1;
diff --git a/t/auto b/t/auto
index c8d4ee3..5f7092d 100755
--- a/t/auto
+++ b/t/auto
@@ -24,7 +24,7 @@ cleanup_() { kill $iwhd_pid; }
# Wait longer than usual (i.e., don't use wait_for_mongo), since this
# mongo daemon was started via iwhd itself, and not with $mongo_opt
-wait_for .1 100 'mongo localhost:$m_port < /dev/null' \
+wait_for .1 300 'mongo localhost:$m_port < /dev/null' \
|| framework_failure_ mongod failed to start
# Wait for up to 20 seconds for iwhd to begin listening on $port.
wait_for .1 200 "curl -s http://localhost:$port" \
12 years, 2 months
[iwhd] build: update gnulib submodule to latest
by Jim Meyering
commit 4173764829d070e7d3413a6472dccf068891a415
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Feb 24 17:42:38 2012 +0100
build: update gnulib submodule to latest
This happens to avoid a minor new compilation failure
when building with --enable-gcc-warnings on Fedora 17.
gnulib | 2 +-
lib/.gitignore | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gnulib b/gnulib
index dc6246c..9fa1fde 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit dc6246c5191f6228c7f3a33f56dc81c226868a99
+Subproject commit 9fa1fde7810f17950543fc5b6c40d953d812a1cc
diff --git a/lib/.gitignore b/lib/.gitignore
index 725563b..cc220b4 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -245,3 +245,4 @@
/xstrtoumax.c
/xvasprintf.c
/xvasprintf.h
+/c-strcaseeq.h
12 years, 2 months
[iwhd] tests: adapt to mongod's new default of using --journal
by Jim Meyering
commit 27f37132461149295061848bab3da90b35b5a4bc
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Feb 23 18:45:16 2012 +0100
tests: adapt to mongod's new default of using --journal
With --journal now the default in Fedora's mongod, start-up takes
at least triple the typical maximum of 5 seconds that we allow
for mongod to initialize and respond to a simple query.
Requiring journal initialization also imposed a much greater
disk footprint, especially when running tests in parallel.
For these reasons, now all test-driven mongod invocations use
--nojournal. While the t/auto tests succeeds when run via
"make -j1 check", it consistently fails with -j$N for 1 < $N.
* t/init.cfg (wait_for): Use warn_, not echo, and don't bother
to warn when sleeping for less than .8 seconds.
(wait_for_mongo): New function.
($mongo_opt): Use --nojournal, if possible.
* t/auto: Add comment saying why we do *not* use wait_for_mongo.
* t/basic: Use $mongo_opt when starting mongod.
Don't redirect mongod output to some file no one will see.
* t/creation-code: Likewise
* t/delete-missing: Likewise.
* t/exercise: Likewise.
* t/mongo-restart: Likewise.
* t/oauth: Likewise.
* t/provider: Likewise.
* t/registration: Likewise.
* t/replication: Likewise.
t/auto | 3 ++-
t/basic | 8 ++++----
t/creation-code | 6 +++---
t/delete-missing | 6 +++---
t/exercise | 6 +++---
t/init.cfg | 17 ++++++++++++++++-
t/mongo-restart | 10 +++++-----
t/oauth | 8 ++++----
t/provider | 6 +++---
t/registration | 6 +++---
t/replication | 8 ++++----
11 files changed, 50 insertions(+), 34 deletions(-)
---
diff --git a/t/auto b/t/auto
index c9f18ab..c8d4ee3 100755
--- a/t/auto
+++ b/t/auto
@@ -22,7 +22,8 @@ iwhd -v -p $port -a &
iwhd_pid=$!
cleanup_() { kill $iwhd_pid; }
-# Wait for up to 10 seconds for mongod to begin listening.
+# Wait longer than usual (i.e., don't use wait_for_mongo), since this
+# mongo daemon was started via iwhd itself, and not with $mongo_opt
wait_for .1 100 'mongo localhost:$m_port < /dev/null' \
|| framework_failure_ mongod failed to start
# Wait for up to 20 seconds for iwhd to begin listening on $port.
diff --git a/t/basic b/t/basic
index c098dc7..7578b1a 100755
--- a/t/basic
+++ b/t/basic
@@ -19,13 +19,13 @@ m_port=$(get_port $mongo_base_port $lock_dir/m-) \
mongod --help > /dev/null || fail_ "the mongod program is not installed"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
-# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
- || framework_failure_ mongod failed to start
+# Wait for mongod to begin listening.
+wait_for_mongo $m_port \
+ || { warn_ boom; sleep 99d; framework_failure_ mongod failed to start; }
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
bucket=http://localhost:$port/b1
diff --git a/t/creation-code b/t/creation-code
index e71f283..8a7671c 100755
--- a/t/creation-code
+++ b/t/creation-code
@@ -10,12 +10,12 @@ m_port=$(get_port $mongo_base_port $lock_dir/m-) \
mongod --help > /dev/null || fail_ "the mongod program is not installed"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -28,7 +28,7 @@ iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
# Wait for up to 5 seconds for iwhd to begin listening on $port.
-wait_for .1 50 "curl -s http://localhost:$port" \
+wait_for_mongo $m_port \
|| { echo iwhd failed to listen; Exit 1; }
diff --git a/t/delete-missing b/t/delete-missing
index 9bc82d6..3291a98 100755
--- a/t/delete-missing
+++ b/t/delete-missing
@@ -12,12 +12,12 @@ m_port=$(get_port $mongo_base_port $lock_dir/m-) \
mongod --help > /dev/null || fail_ "the mongod program is not installed"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -30,7 +30,7 @@ iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
# Wait for up to 5 seconds for iwhd to begin listening on $port.
-wait_for .1 50 "curl -s http://localhost:$port" \
+wait_for_mongo $m_port \
|| { echo iwhd failed to listen; Exit 1; }
diff --git a/t/exercise b/t/exercise
index a1a7282..73a669e 100755
--- a/t/exercise
+++ b/t/exercise
@@ -14,12 +14,12 @@ m_port=$(get_port $mongo_base_port $lock_dir/m-) \
mongod --help > /dev/null || fail_ "the mongod program is not installed"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -33,7 +33,7 @@ iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
# Wait for up to 5 seconds for iwhd to begin listening on $port.
-wait_for .1 50 "curl -s http://localhost:$port" \
+wait_for_mongo $m_port \
|| { echo iwhd failed to listen; Exit 1; }
diff --git a/t/init.cfg b/t/init.cfg
index 858bd38..2539823 100644
--- a/t/init.cfg
+++ b/t/init.cfg
@@ -31,14 +31,29 @@ wait_for()
esac
local i=0
while :; do
- eval "$cmd" && { echo "cmd took $i x ${sleep_seconds}s: '$cmd'"; return 0; }
+ eval "$cmd" && { test $i -ge 8 \
+ && warn_ "cmd took $i*$sleep_seconds seconds: '$cmd'";
+ return 0; }
sleep $sleep_seconds
i=$(expr $i + 1)
+ # Don't even announce that we're waiting unless it's been a few iterations.
+ test $i = 8 \
+ && warn_ "waiting for up to $2 * $1 seconds"
test $i = $max_n_sleeps \
&& { warn_ "EXPIRED: $i x ${sleep_seconds}s: '$cmd'"; return 1; }
done
}
+wait_for_mongo()
+{
+ wait_for .1 100 "mongo localhost:$1 < /dev/null"
+}
+# If we ever stop using --nojournal here, expect to increase the
+# timeout above to something like ".1 * 300" (i.e., 30 seconds),
+# in order to accommodate the cost of journal initialization.
+# Use --nojournal when possible.
+mongo_opt=$(mongod --help| grep -e --nojournal >/dev/null && echo --nojournal)
+
emit_provider_list_prefix()
{
test $1 = xml && p='<providers>' || p='['
diff --git a/t/mongo-restart b/t/mongo-restart
index 03335dd..63a5d9a 100755
--- a/t/mongo-restart
+++ b/t/mongo-restart
@@ -12,12 +12,12 @@ m_port=$(get_port $mongo_base_port $lock_dir/m-) \
mongod --help > /dev/null || fail_ "the mongod program is not installed"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -30,7 +30,7 @@ iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
# Wait for up to 5 seconds for iwhd to begin listening on $port.
-wait_for .1 50 "curl -s http://localhost:$port" \
+wait_for_mongo $m_port \
|| fail_ iwhd failed to listen
curl_w() { curl --write-out '%{http_code}' "$@"; }
@@ -77,11 +77,11 @@ test "$(cat http-code)" = 500 || fail=1
echo 'dummy' | curl_w -T - http://localhost:$port/b1/x > http-code || fail=1
test "$(cat http-code)" = 500 || fail=1
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
creation_evokes_201 b2
diff --git a/t/oauth b/t/oauth
index 7f47414..8dde2ef 100755
--- a/t/oauth
+++ b/t/oauth
@@ -17,12 +17,12 @@ test -f ${abs_top_builddir}/t/poke \
m_port=$(get_port $mongo_base_port $lock_dir/m-) \
|| fail_ "failed to get mongodb port"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -38,7 +38,7 @@ iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
## Wait for up to 5 seconds for iwhd to begin listening on $port.
-wait_for .1 50 \
+wait_for_mongo $m_port \
"poke -v -h localhost:$port -u chiaki -p nodame -l" \
|| fail_ iwhd failed to listen
@@ -77,7 +77,7 @@ chmod 600 iwhd.users
iwhd -v -o -u iwhd.users -p $port -c iwhd.cfg -d localhost:$m_port &
iwhd_pid=$!
-wait_for .1 50 \
+wait_for_mongo $m_port \
"poke -v -h localhost:$port -u chiaki -p nodame -l" \
|| { echo iwhd failed to listen; Exit 1; }
diff --git a/t/provider b/t/provider
index 083cfe0..596b821 100755
--- a/t/provider
+++ b/t/provider
@@ -8,12 +8,12 @@ mkdir FS mongod iwhd || framework_failure_ mkdir failed
m_port=$(get_port $mongo_base_port $lock_dir/m-) \
|| fail_ "failed to get mongodb port"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 5 seconds for mongod to begin listening.
-wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -28,7 +28,7 @@ iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
# Wait for up to 5 seconds for iwhd to begin listening on $port.
-wait_for .1 50 "curl -s http://localhost:$port" \
+wait_for_mongo $m_port \
|| { echo iwhd failed to listen; Exit 1; }
fail=0
diff --git a/t/registration b/t/registration
index c5407a3..a1114cd 100755
--- a/t/registration
+++ b/t/registration
@@ -11,13 +11,13 @@ port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
m_port=$(get_port $mongo_base_port $lock_dir/m-) \
|| fail_ "failed to get mongodb port"
-mongod --port $m_port --pidfilepath reg/mongod/pid --dbpath reg/mongod \
+mongod $mongo_opt --port $m_port --pidfilepath reg/mongod/pid --dbpath reg/mongod \
> reg/mongod.log 2>&1 &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 12 seconds for mongod to begin listening.
-wait_for .1 120 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
# Nobody sanity-checks nfsdir for being absolute pathname, but as it happens
@@ -39,7 +39,7 @@ PATH=$PATH:${abs_top_srcdir} iwhd -v -p $port -c iwhd_reg.conf \
iwhd_pid=$!
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
-wait_for .1 50 "curl -s http://localhost:$port" \
+wait_for_mongo $m_port \
|| framework_failure_ iwhd failed to start
# Create an empty bucket.
diff --git a/t/replication b/t/replication
index 2a7a1ef..6ef09a5 100755
--- a/t/replication
+++ b/t/replication
@@ -15,12 +15,12 @@ mkdir mongod fs_upstream fs_downstream || framework_failure_ mkdir failed
m_port=$(get_port $mongo_base_port $lock_dir/m-) \
|| fail_ "failed to get mongodb port"
-mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod $mongo_opt --port $m_port --pidfilepath mongod/pid --dbpath mongod &
mongo_pid=$!
cleanup_() { kill -9 $mongo_pid; }
# Wait for up to 12 seconds for mongod to begin listening.
-wait_for .1 120 'mongo localhost:$m_port < /dev/null' \
+wait_for_mongo $m_port \
|| framework_failure_ mongod failed to start
port=$(get_port 9095 $lock_dir/i-) || fail_ "failed to get iwhd port"
@@ -36,7 +36,7 @@ EOF
iwhd -v -p $port -c iwhd_u.cfg -d localhost:$m_port &
iwhd_pid=$!
-wait_for .1 50 "curl http://localhost:$port" \
+wait_for_mongo $m_port \
|| framework_failure_ "iwhd upstream"
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }
@@ -48,7 +48,7 @@ EOF
iwhd -v -p $d_port -c iwhd_d.cfg -d localhost:$m_port -m localhost:$port &
iwhd_d_pid=$!
-wait_for .1 50 "curl http://localhost:$d_port" \
+wait_for_mongo $m_port \
|| framework_failure_ "iwhd downstream"
cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid $iwhd_d_pid; }
12 years, 2 months
[iwhd] Document inner workings
by Pete Zaitcev
commit 0d49c58923e98789fd22e3f9d58abde81b824649
Author: Pete Zaitcev <zaitcev(a)kotori.zaitcev.us>
Date: Mon Feb 13 16:20:08 2012 -0700
Document inner workings
As it happens, some of the inner workings of iwhd are less than obvious,
at least until explained. In particular sysadmins would appreciate knowing
what data is stored where and what to remove if something overflows.
This addresses bz#782872. Wes reported the bug but the complaints came
from more than just QA. The iwhd just seems opaque to users generally.
Hopefuly more documentation helps.
doc/admin_guide.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 64 insertions(+), 4 deletions(-)
---
diff --git a/doc/admin_guide.md b/doc/admin_guide.md
index e81b557..46f9993 100644
--- a/doc/admin_guide.md
+++ b/doc/admin_guide.md
@@ -125,7 +125,67 @@ The iwhd writes a log by itself, without syslog. However, when installed
from a package, the log is properly rotated using logrotate(8). The default
location is /var/log/iwhd.log.
-The log format is somewhat arbitrary, but it is being improved.
-
-When troubleshooting, it is advised to add "-v" to IWHD_ARGS in
-/etc/sysconfig/iwhd and restart iwhd.
+The log format includes 2 messages for each API operation. This is done
+because often it is necessary to be aware of operations that take a long
+time to complete. Therefore, one message is logged when the API call
+is received, and another when the operation completes. The two messages
+are correlated using the IP address and port number of the client.
+The following example corresponds to the curl command above:
+
+Dec 06 15:33:43 iwhd[3363]: 192.168.128.11.37750 "GET /" -
+Dec 06 15:33:43 iwhd[3363]: 192.168.128.11.37750 200 302
+
+In the log above, the HTTP GET transfer to the API root completed
+with a code "200" (success) and returned 302 bytes of data.
+
+For additional troubleshooting, it may be helpful to add "-v" to IWHD_ARGS
+in /etc/sysconfig/iwhd and restart iwhd. However, the verbose log is noisy.
+It is generally used only to debug iwhd in a development environment.
+
+Recovery from lack of space
+---------------------------
+
+Lack of space is the most common reason why the error 500 is seen
+returned. It can happen on both PUT and POST transfers, and it is
+most insidious in smaller private clouds that are short on space,
+because iwhd has to use temporary files, which are cleaned up in
+case of error.
+
+In addition, certain kinds of operational errors cause "leaks" of
+resources, at least in the present version, in order to help with
+the troubleshooting by preserving the temporary data which would
+otherwise be deleted. This is the case in particular for registrations
+to RHEV-M or oVirt clouds. Once the root cause of the failing
+registrations is resolved, the accumulated templates have to be
+removed manually.
+
+For these reasons, it is helpful to know where iwhd stores its data
+(not counting logs in /var/log, which are rotated by logrotate).
+Two places are used for permanent data:
+
+ * Attributes and metadata are kept in MongoDB database. Its location
+ is set by the configuration of mongod. The default is /var/lib/mongodb,
+ but it is usually overridden.
+
+ * Bulk data is either stored in the cloud under management, where it
+ is a subject to the controls of the cloud, or in a filesystem-like
+ type of back-end, such as "fs" or "fs-rhev-m". In that case, its
+ location is set as described in chapter "Step by step configuration"
+ above.
+
+Registration operations require additional temporary space to succeed.
+Small control files may be created in /tmp. In addition, registration
+in RHEV-M requires space in the cluster.
+
+ * The image is uploaded to the "Export Domain", seen as an NFS-mounted
+ directory. Location of this directory is set outside of iwhd, by
+ the Aeolus Conductor usually. System crashes may cause half-written
+ templates to accumulate there. Their file names start with "iwhd".
+
+ * Once template is uploaded, it has to be imported, according to the
+ RHEV-M terminology. This process may also fail, leaving a template
+ which is visible to RHEV-M. The safest way to remove this template
+ is from the UI of RHEV-M.
+
+In a busy cloud it is unsafe to remove everything temporary, so look for
+temporary files and templates that are unduly old.
12 years, 2 months
[iwhd] init: avoid race between cat and killproc upon "service iwhd stop"
by Jim Meyering
commit 624c1028c0eb5c705f293f4eff1d4c919c5d099d
Author: Pete Zaitcev <zaitcev(a)redhat.com>
Date: Thu Feb 2 21:08:38 2012 +0100
init: avoid race between cat and killproc upon "service iwhd stop"
* iwhd.init.in (stop): Cat the PID before calling killproc.
iwhd.init.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/iwhd.init.in b/iwhd.init.in
index 2914a6f..809c121 100644
--- a/iwhd.init.in
+++ b/iwhd.init.in
@@ -99,9 +99,9 @@ start() {
}
stop() {
+ pid=$(cat $PIDFILE 2>/dev/null)
action $"Stopping $SERVICE daemon: " killproc -p $PIDFILE $PROCESS
RETVAL=$?
- pid=$(cat $PIDFILE 2>/dev/null)
if test $RETVAL = 0; then
rm -f @localstatedir@/lock/subsys/$SERVICE
rm -f $PIDFILE
12 years, 2 months
[iwhd] init: ignore cat failure upon "service stop iwhd" with no PID file
by Jim Meyering
commit db286402e02d5b9b86183bfa5f239c8affb00a4d
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Feb 2 19:01:45 2012 +0100
init: ignore cat failure upon "service stop iwhd" with no PID file
* iwhd.init.in (stop): Ignore stderr when cat'ing $PIDFILE.
When the file does not exist, we don't want to print a diagnostic.
iwhd.init.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/iwhd.init.in b/iwhd.init.in
index a82622e..2914a6f 100644
--- a/iwhd.init.in
+++ b/iwhd.init.in
@@ -101,7 +101,7 @@ start() {
stop() {
action $"Stopping $SERVICE daemon: " killproc -p $PIDFILE $PROCESS
RETVAL=$?
- pid=$(cat $PIDFILE)
+ pid=$(cat $PIDFILE 2>/dev/null)
if test $RETVAL = 0; then
rm -f @localstatedir@/lock/subsys/$SERVICE
rm -f $PIDFILE
12 years, 2 months