MTD 248-645A Instrukcja Użytkownika Strona 291

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 347
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 290
Linux From Scratch - Version 7.0
271
echo "${pidlist}"
fi
# Get provide correct running status
if [ -n "${pidlist}" ]; then
return 0
else
return 3
fi
fi
if [ "$?" != "0" ]; then
return 3 # Program is not running
fi
}
#*******************************************************************************
# Function - loadproc [-f] [-n nicelevel] [-p pidfile] pathname [args]
#
# Purpose: This runs the specified program as a daemon
#
# Inputs: -f, run the program even if it is already running
# -n nicelevel, specifies a nice level. See nice(1).
# -p pidfile, uses the specified pidfile
# pathname, pathname to the specified program
# args, arguments to pass to specified program
#
# Outputs: return 0 - Success
# return 2 - Invalid of excessive number of arguments,
# warning in stdout
# return 4 - Program or service status is unknown
#
# Dependencies: nice, rm
#
# Todo: LSB says this should be called start_daemon
# LSB does not say that it should call evaluate_retval
# It checks for PIDFILE, which is deprecated.
# Will be removed after BLFS 6.0
# loadproc returns 0 if program is already running, not LSB compliant
#
#*******************************************************************************
loadproc()
{
local pidfile=""
local forcestart=""
local nicelevel="10"
# This will ensure compatibility with previous LFS Bootscripts
if [ -n "${PIDFILE}" ]; then
pidfile="${PIDFILE}"
fi
while true
do
case "${1}" in
-f)
Przeglądanie stron 290
1 2 ... 286 287 288 289 290 291 292 293 294 295 296 ... 346 347

Komentarze do niniejszej Instrukcji

Brak uwag