>Bruce Dubbs wrote:
>>Dean Takemori wrote:
>>lfs/lib/services/init-functions defines statusproc() with this snippit
>>to process arguments:
>>
>>while true; do
>> case "${1}" in
>>
>> -p)
>> pidfile="${2}"
>> shift 2
>> ;;
>> esac
>>done
>>
>>
>>Isn't this broken?
>>
>>What's broken? Can you give an example of how it breaks?
>>
Unless I'm misreading and mis-testing it, there's no break out of
the loop;
For example, given this:
root:/tmp/lfs-bootscripts-20111017# bash --version | head -1
GNU bash, version 4.2.10(2)-release (i686-pc-linux-gnu)
root:/tmp/lfs-bootscripts-20111017# cat /run/fcron.pid
2066
root:/tmp/lfs-bootscripts-20111017# ps xa | grep 2066
2066 ? Ss 0:00 /usr/sbin/fcron
2333 tty1 S+ 0:00 grep 2066
And then doing this:
root:/tmp/lfs-bootscripts-20111017# source lfs/lib/services/init-functions
Both of these never return;
root:/tmp/lfs-bootscripts-20111017# statusproc -p /run/fcron.pid /usr/sbin/fcron
root:/tmp/lfs-bootscripts-20111017# statusproc /usr/sbin/fcron
But if one does instead (after commenting out the init_params
line as per the 7.0 errata)
root:/tmp/lfs-bootscripts-20111017# source lfs/init.d/functions
root:/tmp/lfs-bootscripts-20111017# statusproc -p /run/fcron.pid /usr/sbin/fcron
fcron is running with Process ID(s) 2066.
root:/tmp/lfs-bootscripts-20111017# statusproc /usr/sbin/fcron
fcron is running with Process ID(s) 2066.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page