Re: Typo/bug in pm-utils (FC5)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Leon wrote:
> wwp <subscript@xxxxxxx> 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


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux