FreeBSD Bugzilla – Attachment 82716 Details for
Bug 118325
[patch] [request] new periodic script to test statuses of daemons started via rc system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
490.status-rc.shar
490.status-rc.shar (text/plain), 2.53 KB, created by
Matthew Seaman
on 2007-11-29 06:40:02 UTC
(
hide
)
Description:
490.status-rc.shar
Filename:
MIME Type:
Creator:
Matthew Seaman
Created:
2007-11-29 06:40:02 UTC
Size:
2.53 KB
patch
obsolete
># 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 118325
: 82716