fi
# When using remote connections, such as a serial port, stty size returns 0
-if [ "${COLUMNS}" = "0" ]; then
+if [ "${COLUMNS}" = "0" ]; then
COLUMNS=80
fi
echo "Usage: print_status {success|warning|failure}"
return ${EXIT_CODE_FAILURE}
fi
-
+
case "$1" in
success)
${SUCCESS}
pid="${pid} ${apid}"
fi
done
-
+
# If the $pid variable contains anything (from the previous for loop) it
# means the daemon is already running.
if [ ! -n "${pid}" ]; then
fi
killproc_path ${1} /var/run ${2}
-
+
return ${?}
}
msg_log "Usage: killproc_path {program} {pid-directory} [signal]"
return ${EXIT_CODE_FAILURE}
fi
-
+
# Find the basename of the first parameter (the daemon's name without the
# path).
base=$(/usr/bin/basename ${1})
else
nolevel=1
fi
-
+
# The pidlist variable will contains the output of the pidof command. pidof
# will try to find the PID's that belong to a certain string; $base in this
# case.
pid="${pid} ${apid}"
fi
done
-
+
# If $pid contains something from the previous for loop it means one or
# more PID's were found that belongs to the processes to be killed.
if [ -n "${pid}" ]; then
msg_log "Usage: reloadproc {program} [signal]"
return ${EXIT_CODE_FAILURE}
fi
-
+
# Find the basename of the first parameter (the daemon's name without
# the path that was provided so /usr/sbin/syslogd becomes plain 'syslogd'
# after basename ran).
else
killlevel="-SIGHUP"
fi
-
+
# The pidlist variable will contains the output of the pidof command. pidof
# will try to find the PID's that belong to a certain string; $base in this
# case.
pid="${pid} ${apid}"
fi
done
-
+
# If $pid contains something from the previous for loop it means one or
# more PID's were found that belongs to the processes to be reloaded.
if [ -n "${pid}" ]; then
msg_log "Not running"
return ${EXIT_CODE_WARNING}
fi
-
+
return ${EXIT_CODE_SUCCESS}
}
fi
statusproc_path ${1} /var/run
-
+
return ${?}
}
msg_log "Usage: status {program} {pid-directory}"
return ${EXIT_CODE_FAILURE}
fi
-
+
# Find the basename of the first parameter (the daemon's name without the
# path).
base=$(/usr/bin/basename ${1})
echo "$1 is not a valid symlink"
return ${EXIT_CODE_FAILURE}
fi
-
+
if [ ! -x $1 ]; then
echo "$1 is not executable, skipping"
return ${EXIT_CODE_FAILURE}
fi
-
+
return ${EXIT_CODE_SUCCESS}
}
fi
# First, attempt to stop all services started by previous runlevel,
-# and killed in this runlevel (K8 scripts
+# and killed in this runlevel (K* scripts
# If so, first collect all the K* scripts in the new run level.
if [ ${previous} != N ]; then
for kill_script in $(ls /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null); do
if [ -f ${kill_script} ]; then
# "suffix" will contain the script name without the leading Kxx.
suffix="${kill_script##*/K[0-9][0-9]}"
-
+
# If there is a S script in the previous runlevel corresponding
# to this K script, determine what it's full path is.
previous_start="/etc/rc.d/rc${previous}.d/S[0-9][0-9]${suffix}"