]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/kfreebsd/files/procps.init
start procps before networking
[dsa-puppet.git] / modules / kfreebsd / files / procps.init
1 #! /bin/sh
2 # /etc/init.d/procps: Set kernel variables from /etc/sysctl.conf
3
4 # written by Stephen Gran <sgran@debian.org> based on work by Elrond <Elrond@Wunder-Nett.org>
5
6 ### BEGIN INIT INFO
7 # Provides:          procps
8 # Required-Start:    mountkernfs $local_fs
9 # Required-Stop:
10 # X-Start-Before:    networking
11 # Default-Start:     S
12 # Default-Stop:
13 # Short-Description: Configure kernel parameters at boottime
14 # Description:  Loads kernel parameters that are specified in /etc/sysctl.conf
15 ### END INIT INFO
16
17 PATH=/sbin:/bin
18
19 SYSCTL=/bin/sysctl
20
21 test -x $SYSCTL || exit 0
22
23 . /lib/lsb/init-functions
24
25 # Comment this out for sysctl to print every item changed
26 QUIET_SYSCTL="-q"
27
28 # Check for existance of the default file
29 if [ -f /etc/default/rcS ] ; then
30   . /etc/default/rcS
31 fi
32
33 set -e
34
35 VERBOSE=yes
36 case "$1" in
37         start|restart|force-reload)
38                 log_action_begin_msg "Setting kernel variables "
39                 STATUS=0
40                 for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do
41                         if [ -r "$file" ] ; then
42                                 if [ "$VERBOSE" = "yes" ] ; then
43                                         log_action_cont_msg " $file"
44                                 fi
45                                 egrep -v '^[[:space:]]*(#|$)' "$file" | while read line; do 
46                                         $SYSCTL $QUIET_SYSCTL "$(echo $line | sed -e 's/ = /=/')"
47                                 done
48                         fi
49                 done
50                 log_action_end_msg $STATUS
51                 ;;
52         stop)
53                 ;;
54         *)
55                 echo "Usage: /etc/init.d/procps {start|stop|restart|force-reload}" >&2
56                 exit 3
57                 ;;
58 esac
59
60 exit 0
61