I think it would be appropriate for FreeBSD to include a way of notifying an administrator when a server starts up or shuts down. Attached is an rc.d script I currently add to all my machines. Fix: Add /etc/rc.d/sendpage.sh containing the file below. The file is also available temporarily from http://bilbo.hobbiton.org/sendpage.sh #!/bin/sh # # Copyright (c) 2008 Leif Pedersen # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # # PROVIDE: sendpage # REQUIRE: LOGIN # BEFORE: # KEYWORD: shutdown # Sends a page to admins when the machine boots or shuts down. Example: # sendpage_enable="YES" # sendpage_command="qpage -f '' -p root" sendpage_enable=${sendpage_enable-"NO"} sendpage_command=${sendpage_command-'read subj; echo $subj | mail -s "$subj" root'} . /etc/rc.subr name="sendpage" rcvar=`set_rcvar` load_rc_config $name start_cmd="sendpage_start" stop_cmd="sendpage_stop" timestamp=`date "+%Y-%m-%d %H:%M"` sendpage_start() { echo "Sending startup page." echo "`hostname -s` coming up at $timestamp" | eval "$sendpage_command" } sendpage_stop() { echo "Sending shutdown page." echo "`hostname -s` going down at $timestamp" | eval "$sendpage_command" } run_rc_command "$1"
Responsible Changed From-To: freebsd-bugs->freebsd-rc Fix up the synopsis a little bit, and assign to maintainers.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>