chapter 6.52: psmisc-22.10

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

> Hi Max,
> I saw you posted this on 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

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"`
	echo "ERROR: could not determine target of ${pidof_target}"

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

More information about the lfs-dev mailing list