# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # 490.status-rc # echo x - 490.status-rc sed 's/^X//' >490.status-rc << 'END-of-490.status-rc' X#!/bin/sh X# X# $Id: 490.status-rc,v 1.3 2007/10/21 11:25:25 matthew Exp $ X# $FreeBSD$ X# X X# Define these variables in either /etc/periodic.conf or X# /etc/periodic.conf.local to override the default values. X# X# daily_status_rc_enable="YES" # run tests X# daily_status_rc_exceptions="newsyslog bsdstats.sh othermta" X# # Startup scripts that don't give meaningful status output X Xdaily_status_rc_enable="YES" Xdaily_status_rc_exceptions="newsyslog bsdstats.sh othermta" X X# If there is a global system configuration file, suck it in. X# Xif [ -r /etc/defaults/periodic.conf ] Xthen X . /etc/defaults/periodic.conf X source_periodic_confs Xfi X Xall_startup() { X # Cribbed shamelessly from /etc/rc X X if [ -r /etc/rc.subr ] X then X . /etc/rc.subr X load_rc_config 'XXX' X fi X X skip="-s nostart" X if [ $( /sbin/sysctl -n security.jail.jailed ) -eq 1 ]; then X skip="$skip -s nojail" X fi X X case ${local_startup} in X [Nn][Oo] | '') ;; X *) find_local_scripts_new ;; X esac X X files=$( /sbin/rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null ) X X # Now loop over all of the rc files and query their status X for _rc_elem in ${files}; do X output=$( run_rc_script $_rc_elem status 2>&1 ) X result=$? X X if [ $result -ne 0 ] ; then X X # Many of the system rc-scripts do not support 'status' as X # a command line flag. Most, if not all, of the ports X # rc-cripts do. X X if echo $output | \ X grep -F "unknown directive 'status'" >/dev/null 2>&1 ; then X continue X fi X X # Some rc-scripts do not start long-running processes but X # still provide the default 'status' action. This doesn't X # make a great deal of sense given the default action is X # to test that some process is alive. X X if echo $daily_status_rc_exceptions | \ X grep -F $( basename ${_rc_elem} ) >/dev/null 2>&1 ; then X continue X fi X X echo "==>> $_rc_elem" X echo $output X rc=1 X fi X done X} X X X Xrc=0 X Xcase "$daily_status_rc_enable" in X [Yy][Ee][Ss]) X echo "" X echo "RC Script Status Problems:" X X all_startup X ;; X *) X ;; Xesac X Xexit $rc END-of-490.status-rc exit