4 # Site-specific closing actions for daemons run by init on shutdown,
5 # or before going single-user from multi-user.
6 # Output and errors are directed to console by init, and the
7 # console is the controlling terminal.
11 # Set shell to ignore SIGINT (2), but not children;
12 # shell catches SIGQUIT (3) and returns to single user after fsck.
14 trap : 3 # shouldn't be needed
17 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
20 # If there is a global system configuration file, suck it in.
22 if [ -r /etc/defaults/rc.conf ]; then
23 . /etc/defaults/rc.conf
25 elif [ -r /etc/rc.conf ]; then
29 # Write some entropy so the rebooting /dev/random can reseed
31 case ${entropy_file} in
35 echo "Writing entropy file."
37 touch ${entropy_file} && \
38 chmod 600 ${entropy_file} && \
39 dd if=/dev/random of=${entropy_file} \
40 bs=4096 count=1 2> /dev/null
44 # Check if /var/db/mounttab is clean.
47 if [ -f /var/db/mounttab ]; then
53 echo -n "Shutting down daemon processes: "
55 # for each valid dir in $local_startup, search for init scripts matching *.sh
56 case ${local_startup} in
60 for dir in ${local_startup}; do
61 if [ -d "${dir}" ]; then
62 for script in ${dir}/*.sh; do
63 if [ -x "${script}" ]; then
75 # Insert other shutdown procedures here