[PATCH] init: ignore cat failure upon "service stop iwhd" with no PID file

Jim Meyering jim at meyering.net
Thu Feb 2 20:09:17 UTC 2012


Pete Zaitcev wrote:
> On Thu, 02 Feb 2012 19:03:04 +0100
> Jim Meyering <jim at meyering.net> wrote:
>
>> +++ b/iwhd.init.in
>> @@ -101,7 +101,7 @@ start() {
>>  stop() {
>>      action $"Stopping $SERVICE daemon: " killproc -p $PIDFILE $PROCESS
>>      RETVAL=$?
>> -    pid=$(cat $PIDFILE)
>> +    pid=$(cat $PIDFILE 2>/dev/null)
>>      if test $RETVAL = 0; then
>
> Would not it be well to move the cat up before action? This way
> we would not race killproc, like this:

Good catch.  Definitely.  Thanks.
I'll wait for your ACK on the log message:



More information about the iwhd-devel mailing list