Tuomas Jormola wrote (12 Jan 2009 15:01:03 GMT) : > On Mon, Jan 12, 2009 at 01:17:59PM +0100, intrigeri wrote: >> As pointed out in your comments, the checkpidalive portability needs >> to be fixed; do you intend to do so at some point? > Quick check on Linux/AIX/Solaris/Mac OS X systems would suggest that > ps -A | awk '{print $1}' would give you the list of all the pids running > on the system. On HP-UX, it's ps -e. So maybe something like this could > be done (untested, and we should check at least how *BSD ps behaves)
> function checkpidalive() { > local pid="$1" > [ -z "$pid" ] && return 2 > [ -d /proc/$pid ] && return 0 > local psargs > local uname=`uname` > case "$uname" in > HP-UX) psargs="-e" ;; > *) psargs="-A" ;; > esac > ps $psargs | awk '{print $1}' | grep -q "^${pid}$" > return $? > } Seems fine to me at the first glance, but... have you checked how other programs do so? I bet there is a robust, long-time used piece of code somewhere that does exactly this and takes care of the usual weird corner case. >> Also, why is the hostname needed in the lock file name? > Well I thought that the lock directory might be shared among > different hosts that might all run rdiff-backup, and there might be > similarily named configs on these hosts. But if you hear the voice > of reason in your head, you'll notice that there's too many ifs and > unnecessary complexity involved. Just get rid of the hostname in the > file name, it's not needed at all :) He he. I would not dare sharing /var/lock among several hosts, nor can see the use of doing so. Bye, -- intrigeri <intrig...@boum.org> | gnupg key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc | Do not be trapped by the need to achieve anything. | This way, you achieve everything. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org