blob: 5de96ee471af00a87f3d53e6f4eb779a521b7c72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: localpkg
# REQUIRE: abi
# BEFORE: securelevel
# KEYWORD: shutdown
. /etc/rc.subr
name="localpkg"
start_cmd="pkg_start"
stop_cmd="pkg_stop"
pkg_start()
{
# For each dir in $local_startup, search for init scripts matching *.sh
#
case ${local_startup} in
[Nn][Oo] | '')
;;
*)
echo -n 'Local package initialization:'
find_local_scripts_old
for script in ${zlist} ${slist}; do
if [ -x "${script}" ]; then
(set -T
trap 'exit 1' 2
${script} start)
elif [ -f "${script}" -o -L "${script}" ]; then
echo -n " (skipping ${script}, not executable)"
fi
done
echo '.'
;;
esac
}
pkg_stop()
{
case ${local_startup} in
[Nn][Oo] | '')
;;
*)
echo -n 'Shutting down daemon processes:'
find_local_scripts_old
for script in `reverse_list ${slist} ${zlist}`; do
if [ -x "${script}" ]; then
if [ `sysctl -n debug.bootverbose` -eq 1 ]; then
echo "==>" ${script}
fi
(set -T
trap 'exit 1' 2
${script} stop)
fi
done
echo '.'
;;
esac
}
load_rc_config $name
run_rc_command "$1"
|