MTD 248-645A Manual de usuario Pagina 294

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 347
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 293
Linux From Scratch - Version 7.0
274
# Is the process running?
if [ -z "${pidfile}" ]; then
pidofproc -s "${1}"
else
pidofproc -s -p "${pidfile}" "${1}"
fi
# Remove stale pidfile
if [ "$?" = 1 ]; then
boot_mesg "Removing stale pid file: ${pidfile}." ${WARNING}
rm -f "${pidfile}"
fi
# If running, send the signal
if [ -n "${pidlist}" ]; then
for pid in ${pidlist}
do
kill -${killsig} ${pid} 2>/dev/null
# Wait up to 3 seconds, for ${pid} to terminate
case "${killsig}" in
TERM|SIGTERM|KILL|SIGKILL)
# sleep in 1/10ths of seconds and
# multiply KILLDELAY by 10
local dtime="${KILLDELAY}0"
while [ "${dtime}" != "0" ]
do
kill -0 ${pid} 2>/dev/null || break
sleep 0.1
dtime=$(( ${dtime} - 1))
done
# If ${pid} is still running, kill it
kill -0 ${pid} 2>/dev/null && kill -KILL ${pid} 2>/dev/null
;;
esac
done
# Check if the process is still running if we tried to stop it
case "${killsig}" in
TERM|SIGTERM|KILL|SIGKILL)
if [ -z "${pidfile}" ]; then
pidofproc -s "${1}"
else
pidofproc -s -p "${pidfile}" "${1}"
fi
# Program was terminated
if [ "$?" != "0" ]; then
# Remove the pidfile if necessary
if [ -f "${pidfile}" ]; then
rm -f "${pidfile}"
fi
echo_ok
return 0
else # Program is still running
echo_failure
return 4 # Unknown Status
Vista de pagina 293
1 2 ... 289 290 291 292 293 294 295 296 297 298 299 ... 346 347

Comentarios a estos manuales

Sin comentarios