Você deve usar o PID e o PIDFILE no caminho certo. Por exemplo (do meu script de trabalho):
case "$1" in
start)
if [ -f $PIDFILE ]; then
echo "LibreOffice headless server has already started."
sleep 5
exit
fi
echo "Starting LibreOffice headless server"
$SOFFICE_PATH --headless --nologo --nofirststartwizard -- accept="socket,host=127.0.0.1,port=2002;urp" & > /dev/null 2>&1
PID='ps ax|grep "soffice.bin --headless"|grep -v grep|cut -d \ -f 1'
echo $PID> $PIDFILE
;;
stop)
if [ -f $PIDFILE ]; then
echo "Stopping LibreOffice headless server."
kill 'cat $PIDFILE'
rm -f $PIDFILE
exit
fi
echo "LibreOffice headless server is not running."
exit
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac