chapter 6.52: psmisc-22.10

user max.mann at web.de
Thu Sep 16 19:47:15 PDT 2010


> 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.

Best Regards
Max





More information about the lfs-dev mailing list