gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <>
Subject Re: Need testers for gump3 branch + windows
Date Wed, 20 Apr 2005 19:19:53 GMT
Adam R. B. Jack wrote:
>>I just committed some updates to the gump3 branch that "on my machine",
>>allow me to run on cygwin+winxp+python2.4-win32. Could some people try and
> Some cygwin testing:


> $ bash gump webgump
> hostname: invalid option -- s
> Try `hostname --help' for more information.
> ./bin/debug: line 24:
> /cygdrive/f/data/Python/Gump3-SVN/webgump/lib/apache2-inst
> all/current/bin/httpd: No such file or directory

ah right, I suspect that the "webgump" code will currently only "work on 
my machine", and even that is dubious. I have no idea whether we should 
move forward with it. Basically for me it mostly depends on how much 
time Stefano and fellow cocooners want to invest in dynagump, 'cuz I 
certainly can't get that implemented on my own.

> $ bash gump kill
> ps: unknown option -- o

ugh. I forgot; one pretty much cannot count on ps working well on cygwin 
at all. -o is probably a GNU extension. We'll probably have to 
grep/sed/awk our way through this. "Please file an issue" kind of thing ;)

> BTW: On posix I was able to lock the "pid file" and test if that file was
> still locked, i.e. the process was running. For cron based automatic runs I
> think that is nicer than requiring a manual kill. Something (IMHO) to add to
> the wish list sometime.

Well, I'm no expert, but I believe that file locking is usually not 
considered very reliable or portable. At least the sysvinit packages 
that float around various linux distributions inspect /proc and compare 
with a pid file instead of using locking. If its worked for unix since 
sysv, it might make sense just to copy. In fact, I basically took a look 
at the sh functions sourced from /etc/init.d files and tried to copy 
what they did. Just need to figure out how to interact with /proc on 
cygwin and we can lose the use of "ps" and be portable and robust and 
all. I.e. (from /lib/lsb/init-functions on my machine, snippet copyright 
Chris Lawrence, all rights reserved)

pidofproc () {
     local pidfile line i pids= status
     set -- `POSIXLY_CORRECT=1 getopt "p:" $*`

     for i in $*; do
         case $i in
             -p)  pidfile=$2; shift 2;;
             --)  shift; break;;

     if [ -z "$pidfile" ]; then
         pidfile=/var/run/$(basename "$1").pid

     if [ -f "$pidfile" ]; then
         read -d "" line < "$pidfile"
         for i in $line; do
             if [ -z "$(echo $p | sed 's/[0-9]//g')" -a -d "/proc/$i" ]; 
                 pids="$i $pids"
         if [ -n "$pids" ]; then
             echo "$pids"
             return 0
             return 2 # program is dead and /var/run pid file exists
     elif [ -x /bin/pidof ]; then
         /bin/pidof -o %PPID $1
         [ "$status" = 1 ] && return 3 # program is not running
         return 0
         return 4 # program or service is unknown

Do you have any pointers to docs where they suggest doing things 



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message