3 # $FreeBSD: src/etc/rc.d/localdaemons,v 1.2 2003/05/05 15:38:41 mtm Exp $
6 # PROVIDE: localdaemons
13 start_cmd="locald_start"
14 stop_cmd="locald_stop"
16 # Returns true (0) if the passed argument is a valid name
17 # for a script, false (1) otherwise.
37 # For each dir in $local_startup, search for init scripts matching *
39 case ${local_startup} in
43 echo -n 'Local package initialization:'
45 if [ -z "${script_name_sep}" ]; then
48 for dir in ${local_startup}; do
49 if [ -d "${dir}" ]; then
50 for script in ${dir}/*; do
51 if valid_scriptname ${script}; then
52 slist="${slist}${script_name_sep}${script}"
58 # If the firstboot sentinel doesn't exist, we want to
59 # skip firstboot scripts.
61 if ! [ -e /firstboot ]; then
62 skip_firstboot="-s firstboot"
65 script_save_sep="$IFS"
66 IFS="${script_name_sep}"
67 sortedslist=`rcorder -s nostart ${skip_firstboot} /etc/rc.d/* ${slist} 2>/dev/null | grep -v "^/etc/rc.d/" | tr '\n' "$IFS"`;
68 for script in ${sortedslist}; do
69 if [ -x "${script}" ]; then
73 elif [ -f "${script}" -o -L "${script}" ]; then
74 echo -n " (skipping ${script##*/}, not executable)"
77 IFS="${script_save_sep}"
85 echo -n 'Shutting down daemon processes:'
87 # For each dir in $local_startup, search for init scripts matching *
88 case ${local_startup} in
93 if [ -z "${script_name_sep}" ]; then
96 for dir in ${local_startup}; do
97 if [ -d "${dir}" ]; then
98 for script in ${dir}/*; do
99 if valid_scriptname ${script}; then
100 slist="${slist}${script_name_sep}${script}"
106 # If the firstboot sentinel doesn't exist, we want to
107 # skip firstboot scripts.
109 if ! [ -e /firstboot ]; then
110 skip_firstboot="-s firstboot"
113 script_save_sep="$IFS"
114 IFS="${script_name_sep}"
115 sortedslist=`rcorder -s nostart ${skip_firstboot} /etc/rc.d/* ${slist} 2>/dev/null | grep -v "^/etc/rc.d/" | tr '\n' "$IFS"`;
116 for script in `reverse_list ${sortedslist}`; do
117 if [ -x "${script}" ]; then
123 IFS="${script_save_sep}"