Typo/bug in pm-utils (FC5)?

Sjoerd Mullender sjoerd at acm.org
Thu Apr 27 19:07:47 UTC 2006


Leon wrote:
> wwp <subscript at free.fr> writes:
> 
>> Hello all,
>>
>>
>> isn't there a typo in /etc/pm/functions from pm-utils-0.15-1 (FC5)?
>> I was wondering in what directory ./suspended was looked for.. until I read
>> the next lines, who make reference to /.suspended!
>>
>> --- functions.orig      2006-04-23 23:52:00.000000000 +0200
>> +++ functions   2006-04-23 23:50:11.000000000 +0200
>> @@ -104,7 +104,7 @@
>>  {
>>         VT=$(/usr/bin/fgconsole)
>>         chvt 63
>> -       if [ -f ./suspended ]; then
>> +       if [ -f /.suspended ]; then
>>                 pid=$(cat /.suspended)
>>                 if [ -d /proc/$pid ]; then
>>                         return 1
>>
>>
>> Regards,
>>
>> -- 
>> wwp
> 
> There are three appearances of /.suspended. I guess it is not a
> bug. But any reason to put .suspended in /?
> 

It looks most definitely like a bug.  /.suspended is used as a lock to
prevent multiple instances of the script from running.  When /.suspended
exists, it contains the process ID of the script doing the suspension.
If a second script is started, it sees the file (after the patch) and
checks whether the process with the process ID is still alive.  If it
is, the second script exits.

-- 
Sjoerd Mullender


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 369 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20060427/05a3338e/attachment-0002.bin 


More information about the users mailing list