Here's my /etc/rc.local
script, which I install on NetBSD, FreeBSD, and OpenBSD:
# $NetBSD: rc.local,v 1.32 2008/06/11 17:14:52 perry Exp $
# originally from: @(#)rc.local 8.3 (Berkeley) 4/28/94
#
# This file is (nearly) the last thing invoked by /etc/rc during a
# normal boot, via /etc/rc.d/local.
#
# It is intended to be edited locally to add site-specific boot-time
# actions, such as starting locally installed daemons.
#
# An alternative option is to create site-specific /etc/rc.d scripts.
#
case "$(uname -s)" in
FreeBSD)
;;
*)
echo -n 'Starting local daemons:'
;;
esac
# Add your local daemons here, eg:
#
#if [ -x /path/to/daemon ]; then
# /path/to/daemon args
#fi
if [ -x /home/reboot-message ]
then
echo -n ' reboot-message'
/home/reboot-message
fi
case "$(uname -s)" in
FreeBSD)
;;
*)
echo '.'
;;
esac
It is basically just running /home/reboot-message
, which is a script that emails the dmesg(8)
output to me, notifying me that a machine has booted up.