NEC Express5800/320Lb Linux Uživatelská příručka Strana 61

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 97
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 60
61
<For processes that fork other child processes (e.g. “squid”)>
On the FT server, you could create a script that takes in command line
arguments start and stop. This script should also have the logic of starting,
stopping and monitoring the process by based on its Process ID (“pid”), and
should terminate if the process terminates.
You could refer to this sample script (/opt/nec/clusterpro/monitors/squidexec)
customized for the squid process:
#!/bin/bash
case "$1" in
start)
/etc/init.d/squid start
sleep 3
processid=`cat /var/run/squid.pid 2> /dev/null &`
while [ 1 ]
do
status=`ps --pid $processid --no-headers 2> /dev/null
&`
if [ "$status" != "" ]
then
sleep 1
else
exit 1
fi
done
;;
stop)
/etc/init.d/squid stop
;;
esac
Zobrazit stránku 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 96 97

Komentáře k této Příručce

Žádné komentáře