From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: Xen scripts rewrite Date: Fri, 2 Mar 2012 14:30:48 +0100 Message-ID: References: <20120301124243.9B202298942@mx1.internecto.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120301124243.9B202298942@mx1.internecto.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mark Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 2012/3/1 Mark : > Greetings, > > I am trying to wrap my head around the xen scripts in /etc/xen/scripts. > I am currently looking at locking.sh but I don't really understand what > it is doing. > > I see that claim_lock has a while loop, it seems to wait until it can > write its own PID to $lockdir/owner. If the file $lockdir/owner exists, > check if the pid is still running. If it's still running when the > loop is done, steal the lock by writing $$ to $lockdir/owner anyway. > > Anyway. Can someone please further explain this file in plain English > and detail. Am I right with my above assumptions, and when are locks > even used? > > As said, I request as much detail as possible - the rewrite is to > improve efficiency, readability and user customisation. As it is now > you have too much functions that confuse me silly. > > If I am succesful I will share the outcome, so there's an incentive if > you need one. If you can, could you also clean the scripts of bashisms? so all of them use /bin/sh. Now some of them use /bin/sh and some use /bin/bash and I don't really like to install bash just for launching some hotplug scripts. > Thank you, > Mark > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel