chapter 6.52: psmisc-22.10

Bruce Dubbs bruce.dubbs at gmail.com
Thu Sep 16 20:28:16 PDT 2010


user wrote:
>> Hi Max,
>>
>> I saw you posted this on Linuxquestions.org too. Do I understand
>> correctly that your advice is to _not_ issue the optional command?
>>
>> Thanks,
>>
>> - -Drew
> 
> Hi Drew,
> 
> yes, that is indeed what I am suggesting. Since keeping the command will
> result in an error it is not _really_ an option.
> So far noone has verified/falsified this behavior. This can be easily
> done by pointing /bin/pidof to killall instead of killall5. I attached a
> screenshot of the expected output over at LQ.
> An alternative would be to modify the script
> /etc/rc.d/init.d/functions
> 
> Replacing the line
> pidlist=`pidof -o $$ -o $PPID -x "$1"`
> 
> with something like
> 
> pidof_type=$(type pidof)
> pidof_target=$(stat -c "%N" ${pidof_type##* } | sed -r
> 's/.*`(.*).$/\1/' )
> 
> if [[ ${pidof_target} = *killall5 ]]; then
> 	pidlist=`pidof -o $$ -o $PPID -x "$1"`
> elif [[ ${pidof_target} = *killall ]]; then
> 	pidlist=`pidof -e "$1"`
> else
> 	echo "ERROR: could not determine target of ${pidof_target}"
> fi
> 
> will handle both situations.
> However, since the book states that killall5 is the better alternative I
> still suggest that the optional step is removed instead of tweaking the
> start scripts.

Some users don't want to use sysvinit, but I think I agree that we 
should remove the symlink and the text associated with it.  killall 
should still be moved to /bin though.

Normally this doesn't cause a problem because the installation of 
sysvinit overwrites the pidof symlink with a link to killall5.

   -- Bruce



More information about the lfs-dev mailing list