On Sat, Nov 14, 2009 at 9:24 PM, Peter Körner <[email protected]> wrote:
> Yes, it does. This is a bug i introduced yesterday. Sorry for that..
> Something I'm also unsure about is expire.rb's runtime. I activated it
> friday and it took twice as long as the import into psql, so i disabled
> it saturday morning, so that the diff is now catching up again.
>
> Maybe some indices are missing?

No idea:)

I've made it use kill -0 instead of ps:

a...@cassini:/sql/diffs$ diff -ru load-next~ load-next
--- load-next~  2009-11-14 21:32:41.000000000 +0000
+++ load-next   2009-11-14 21:32:41.000000000 +0000
@@ -33,7 +33,8 @@
 fi

 if [ -s $PIDFILE ]; then
-       if [ "$(ps -p `cat $PIDFILE` | wc -l)" -gt 1 ]; then
+       # if [ "$(ps -p `cat $PIDFILE` | wc -l)" -gt 1 ]; then
+       if [ kill -0 `cat $PIDFILE` 2>/dev/null ]; then
                m_info "pid `cat $PIDFILE` still running"
                exit 3
        fi


When I run this:

a...@cassini:/sql/diffs$ while sleep 60; do cat load-next.pid &&
hexdump -C load-next.pid  && ps aux | grep $(cat load-next.pid); done

I get:

root     22599  0.0  0.0   8844  1208 ?        Ss   20:55   0:00
/bin/bash /sql/diffs/load-next
ravar    25130  0.0  0.0   6312   772 pts/10   R+   21:19   0:00 grep 22599
22599
00000000  32 32 35 39 39 0a                                 |22599.|
00000006
root     22599  0.0  0.0   8844  1208 ?        Ss   20:55   0:00
/bin/bash /sql/diffs/load-next
ravar    25483  0.0  0.0   6312   784 pts/10   R+   21:20   0:00 grep 22599

00000000  0a                                                |.|
00000001
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

00000000  0a                                                |.|
00000001
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

00000000  0a                                                |.|
00000001
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

00000000  0a                                                |.|
00000001
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
25576
00000000  32 35 35 37 36 0a                                 |25576.|
00000006
root     25576  0.0  0.0   8844  1204 ?        Ss   21:25   0:00
/bin/bash /sql/diffs/load-next
ravar    25951  0.0  0.0   6312   776 pts/10   R+   21:25   0:00 grep 25576
25576

Which is odd.

echo > foo
test -s foo

Returns false though, so I don't see how ps could have been called
with -p being a non-pid.

_______________________________________________
Maps-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/maps-l

Reply via email to