diff options
Diffstat (limited to 'meta/packages/sysvinit/sysvinit')
-rwxr-xr-x | meta/packages/sysvinit/sysvinit/bootlogd.init | 85 | ||||
-rw-r--r-- | meta/packages/sysvinit/sysvinit/inittab | 30 | ||||
-rw-r--r-- | meta/packages/sysvinit/sysvinit/need | 6 | ||||
-rw-r--r-- | meta/packages/sysvinit/sysvinit/postinst | 17 | ||||
-rw-r--r-- | meta/packages/sysvinit/sysvinit/prerm | 9 | ||||
-rw-r--r-- | meta/packages/sysvinit/sysvinit/provide | 6 | ||||
-rwxr-xr-x | meta/packages/sysvinit/sysvinit/rc | 102 | ||||
-rwxr-xr-x | meta/packages/sysvinit/sysvinit/rcS | 110 | ||||
-rw-r--r-- | meta/packages/sysvinit/sysvinit/rcS-default | 21 |
9 files changed, 386 insertions, 0 deletions
diff --git a/meta/packages/sysvinit/sysvinit/bootlogd.init b/meta/packages/sysvinit/sysvinit/bootlogd.init new file mode 100755 index 0000000000..f8f07a050f --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/bootlogd.init | |||
@@ -0,0 +1,85 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # bootlogd One of the first scripts to be executed. Starts or stops | ||
4 | # the bootlogd log program. If this script is called as | ||
5 | # "stop-bootlogd", it will stop the daemon instead of | ||
6 | # starting it even when called with the "start" argument. | ||
7 | # | ||
8 | # Version: @(#)bootlogd 2.85-12 21-Mar-2004 miquels@cistron.nl | ||
9 | # | ||
10 | |||
11 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
12 | DAEMON=/sbin/bootlogd | ||
13 | NAME=bootlogd | ||
14 | DESC="Bootlog daemon" | ||
15 | |||
16 | test -f $DAEMON || exit 0 | ||
17 | |||
18 | [ -r /etc/default/bootlogd ] && . /etc/default/bootlogd | ||
19 | |||
20 | ## set -e # not needed | ||
21 | |||
22 | case "$BOOTLOGD_ENABLE" in | ||
23 | [Nn]*) | ||
24 | exit 0 | ||
25 | ;; | ||
26 | esac | ||
27 | |||
28 | STOPPER= | ||
29 | ACTION="$1" | ||
30 | case "$0" in | ||
31 | *stop-bootlog*) | ||
32 | STOPPER=Y | ||
33 | if [ "$ACTION" = start ] | ||
34 | then | ||
35 | ACTION=stop | ||
36 | fi | ||
37 | ;; | ||
38 | esac | ||
39 | |||
40 | case "$ACTION" in | ||
41 | start) | ||
42 | echo -n "Starting $DESC: " | ||
43 | if [ -d /proc/1/. ] | ||
44 | then | ||
45 | umask 027 | ||
46 | start-stop-daemon --start --quiet \ | ||
47 | --exec $DAEMON -- -r | ||
48 | else | ||
49 | $DAEMON -r | ||
50 | fi | ||
51 | echo "$NAME." | ||
52 | ;; | ||
53 | stop) | ||
54 | echo -n "Stopping $DESC: " | ||
55 | start-stop-daemon --stop --quiet --exec $DAEMON | ||
56 | |||
57 | if [ "$STOPPER" ] && [ -f /var/log/boot ] && \ | ||
58 | [ -f /var/log/boot~ ] | ||
59 | then | ||
60 | cd /var/log | ||
61 | chgrp adm boot | ||
62 | savelog -p -c 5 boot > /dev/null 2>&1 | ||
63 | mv boot.0 boot | ||
64 | mv boot~ boot.0 | ||
65 | fi | ||
66 | |||
67 | echo "$NAME." | ||
68 | ;; | ||
69 | restart|force-reload) | ||
70 | echo -n "Restarting $DESC: " | ||
71 | start-stop-daemon --stop --quiet --exec $DAEMON | ||
72 | sleep 1 | ||
73 | start-stop-daemon --start --quiet --exec $DAEMON | ||
74 | echo "$NAME." | ||
75 | ;; | ||
76 | *) | ||
77 | N=${0##*/} | ||
78 | N=${N#[SK]??} | ||
79 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 | ||
80 | exit 1 | ||
81 | ;; | ||
82 | esac | ||
83 | |||
84 | exit 0 | ||
85 | |||
diff --git a/meta/packages/sysvinit/sysvinit/inittab b/meta/packages/sysvinit/sysvinit/inittab new file mode 100644 index 0000000000..6abbdf4558 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/inittab | |||
@@ -0,0 +1,30 @@ | |||
1 | # /etc/inittab: init(8) configuration. | ||
2 | # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ | ||
3 | |||
4 | # The default runlevel. | ||
5 | id:5:initdefault: | ||
6 | |||
7 | # Boot-time system configuration/initialization script. | ||
8 | # This is run first except when booting in emergency (-b) mode. | ||
9 | si::sysinit:/etc/init.d/rcS | ||
10 | |||
11 | # What to do in single-user mode. | ||
12 | ~~:S:wait:/sbin/sulogin | ||
13 | |||
14 | # /etc/init.d executes the S and K scripts upon change | ||
15 | # of runlevel. | ||
16 | # | ||
17 | # Runlevel 0 is halt. | ||
18 | # Runlevel 1 is single-user. | ||
19 | # Runlevels 2-5 are multi-user. | ||
20 | # Runlevel 6 is reboot. | ||
21 | |||
22 | l0:0:wait:/etc/init.d/rc 0 | ||
23 | l1:1:wait:/etc/init.d/rc 1 | ||
24 | l2:2:wait:/etc/init.d/rc 2 | ||
25 | l3:3:wait:/etc/init.d/rc 3 | ||
26 | l4:4:wait:/etc/init.d/rc 4 | ||
27 | l5:5:wait:/etc/init.d/rc 5 | ||
28 | l6:6:wait:/etc/init.d/rc 6 | ||
29 | # Normally not reached, but fallthrough in case of emergency. | ||
30 | z6:6:respawn:/sbin/sulogin | ||
diff --git a/meta/packages/sysvinit/sysvinit/need b/meta/packages/sysvinit/sysvinit/need new file mode 100644 index 0000000000..4d84bbeee7 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/need | |||
@@ -0,0 +1,6 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # need binary that doesnt do anything, supplied for simpleinit | ||
4 | # vs sysvinit compatibility for the supplied startup scripts | ||
5 | |||
6 | exit 0 | ||
diff --git a/meta/packages/sysvinit/sysvinit/postinst b/meta/packages/sysvinit/sysvinit/postinst new file mode 100644 index 0000000000..b6fe547fa4 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/postinst | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/busybox ash | ||
2 | |||
3 | action="$1" | ||
4 | oldversion="$2" | ||
5 | |||
6 | umask 022 | ||
7 | |||
8 | if [ "$action" != configure ] | ||
9 | then | ||
10 | exit 0 | ||
11 | fi | ||
12 | |||
13 | update-alternatives --install /sbin/init init /sbin/sysvinit 25 | ||
14 | update-alternatives --install /sbin/need need /sbin/need.sysvinit 25 | ||
15 | update-alternatives --install /sbin/provide provide /sbin/provide.sysvinit 25 | ||
16 | |||
17 | exit 0 | ||
diff --git a/meta/packages/sysvinit/sysvinit/prerm b/meta/packages/sysvinit/sysvinit/prerm new file mode 100644 index 0000000000..704a29ffd5 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/prerm | |||
@@ -0,0 +1,9 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ "$1" != "upgrade" ]; then | ||
4 | update-alternatives --remove need /sbin/need.sysvinit | ||
5 | update-alternatives --remove provide /sbin/provide.sysvinit | ||
6 | update-alternatives --remove init /sbin/sysvinit | ||
7 | fi | ||
8 | |||
9 | exit 0 | ||
diff --git a/meta/packages/sysvinit/sysvinit/provide b/meta/packages/sysvinit/sysvinit/provide new file mode 100644 index 0000000000..c90cf3537b --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/provide | |||
@@ -0,0 +1,6 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # provide binary that doesnt do anything, supplied for simpleinit | ||
4 | # vs sysvinit compatibility for the supplied startup scripts | ||
5 | |||
6 | exit 0 | ||
diff --git a/meta/packages/sysvinit/sysvinit/rc b/meta/packages/sysvinit/sysvinit/rc new file mode 100755 index 0000000000..fdb0fce887 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/rc | |||
@@ -0,0 +1,102 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # rc This file is responsible for starting/stopping | ||
4 | # services when the runlevel changes. | ||
5 | # | ||
6 | # Optimization feature: | ||
7 | # A startup script is _not_ run when the service was | ||
8 | # running in the previous runlevel and it wasn't stopped | ||
9 | # in the runlevel transition (most Debian services don't | ||
10 | # have K?? links in rc{1,2,3,4,5} ) | ||
11 | # | ||
12 | # Author: Miquel van Smoorenburg <miquels@cistron.nl> | ||
13 | # Bruce Perens <Bruce@Pixar.com> | ||
14 | # | ||
15 | # Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl | ||
16 | # | ||
17 | |||
18 | . /etc/default/rcS | ||
19 | export VERBOSE | ||
20 | |||
21 | # | ||
22 | # Start script or program. | ||
23 | # | ||
24 | startup() { | ||
25 | case "$1" in | ||
26 | *.sh) | ||
27 | sh "$@" | ||
28 | ;; | ||
29 | *) | ||
30 | "$@" | ||
31 | ;; | ||
32 | esac | ||
33 | } | ||
34 | |||
35 | # Ignore CTRL-C only in this shell, so we can interrupt subprocesses. | ||
36 | trap ":" INT QUIT TSTP | ||
37 | |||
38 | # Set onlcr to avoid staircase effect. | ||
39 | stty onlcr 0>&1 | ||
40 | |||
41 | # Now find out what the current and what the previous runlevel are. | ||
42 | |||
43 | runlevel=$RUNLEVEL | ||
44 | # Get first argument. Set new runlevel to this argument. | ||
45 | [ "$1" != "" ] && runlevel=$1 | ||
46 | if [ "$runlevel" = "" ] | ||
47 | then | ||
48 | echo "Usage: $0 <runlevel>" >&2 | ||
49 | exit 1 | ||
50 | fi | ||
51 | previous=$PREVLEVEL | ||
52 | [ "$previous" = "" ] && previous=N | ||
53 | |||
54 | export runlevel previous | ||
55 | |||
56 | # Is there an rc directory for this new runlevel? | ||
57 | if [ -d /etc/rc$runlevel.d ] | ||
58 | then | ||
59 | # First, run the KILL scripts. | ||
60 | if [ $previous != N ] | ||
61 | then | ||
62 | for i in /etc/rc$runlevel.d/K[0-9][0-9]* | ||
63 | do | ||
64 | # Check if the script is there. | ||
65 | [ ! -f $i ] && continue | ||
66 | |||
67 | # Stop the service. | ||
68 | startup $i stop | ||
69 | done | ||
70 | fi | ||
71 | # Now run the START scripts for this runlevel. | ||
72 | for i in /etc/rc$runlevel.d/S* | ||
73 | do | ||
74 | [ ! -f $i ] && continue | ||
75 | |||
76 | if [ $previous != N ] && [ $previous != S ] | ||
77 | then | ||
78 | # | ||
79 | # Find start script in previous runlevel and | ||
80 | # stop script in this runlevel. | ||
81 | # | ||
82 | suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]} | ||
83 | stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix | ||
84 | previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix | ||
85 | # | ||
86 | # If there is a start script in the previous level | ||
87 | # and _no_ stop script in this level, we don't | ||
88 | # have to re-start the service. | ||
89 | # | ||
90 | [ -f $previous_start ] && [ ! -f $stop ] && continue | ||
91 | fi | ||
92 | case "$runlevel" in | ||
93 | 0|6) | ||
94 | startup $i stop | ||
95 | ;; | ||
96 | *) | ||
97 | startup $i start | ||
98 | ;; | ||
99 | esac | ||
100 | done | ||
101 | fi | ||
102 | # eof /etc/init.d/rc | ||
diff --git a/meta/packages/sysvinit/sysvinit/rcS b/meta/packages/sysvinit/sysvinit/rcS new file mode 100755 index 0000000000..e7a7e617d0 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/rcS | |||
@@ -0,0 +1,110 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # rcS Call all S??* scripts in /etc/rcS.d in | ||
4 | # numerical/alphabetical order. | ||
5 | # | ||
6 | # Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl | ||
7 | # | ||
8 | |||
9 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
10 | runlevel=S | ||
11 | prevlevel=N | ||
12 | umask 022 | ||
13 | export PATH runlevel prevlevel | ||
14 | |||
15 | # Make sure proc is mounted | ||
16 | # | ||
17 | [ -d "/proc/1" ] || mount /proc | ||
18 | |||
19 | # | ||
20 | # See if system needs to be setup. This is ONLY meant to | ||
21 | # be used for the initial setup after a fresh installation! | ||
22 | # | ||
23 | if [ -x /sbin/unconfigured.sh ] | ||
24 | then | ||
25 | /sbin/unconfigured.sh | ||
26 | fi | ||
27 | |||
28 | # | ||
29 | # Source defaults. | ||
30 | # | ||
31 | . /etc/default/rcS | ||
32 | |||
33 | # | ||
34 | # Trap CTRL-C &c only in this shell so we can interrupt subprocesses. | ||
35 | # | ||
36 | trap ":" INT QUIT TSTP | ||
37 | |||
38 | # | ||
39 | # Do we have /proc/progress and set VERBOSE to "no" ? | ||
40 | # If so, calculate the number of scripts and the incremental step | ||
41 | # | ||
42 | if [ "$VERBOSE" = no ]; then | ||
43 | if [ -e /proc/progress ]; then | ||
44 | set `ls -1 /etc/rc$runlevel.d/S* | wc` | ||
45 | numscripts=$1 | ||
46 | PROGRESS_incstep=`expr 90 / $1` | ||
47 | PROGRESS_value=10 | ||
48 | PROGRESS=yes | ||
49 | export PROGRESS_value PROGRESS_incstep | ||
50 | fi | ||
51 | fi | ||
52 | export VERBOSE PROGRESS | ||
53 | |||
54 | # | ||
55 | # Call all parts in order. | ||
56 | # | ||
57 | for i in /etc/rcS.d/S??* | ||
58 | do | ||
59 | # Ignore dangling symlinks for now. | ||
60 | [ ! -f "$i" ] && continue | ||
61 | |||
62 | # Handle verbosity | ||
63 | [ "$VERBOSE" = very ] && echo "INIT: Running $i..." | ||
64 | if [ "$PROGRESS" = yes ]; then | ||
65 | export PROGRESS_value=`expr $PROGRESS_value + $PROGRESS_incstep` | ||
66 | echo "$PROGRESS_value Starting $i..." >/proc/progress | ||
67 | fi | ||
68 | |||
69 | case "$i" in | ||
70 | *.sh) | ||
71 | # Source shell script for speed. | ||
72 | ( | ||
73 | trap - INT QUIT TSTP | ||
74 | set start | ||
75 | . $i | ||
76 | ) | ||
77 | ;; | ||
78 | *) | ||
79 | # No sh extension, so fork subprocess. | ||
80 | $i start | ||
81 | ;; | ||
82 | esac | ||
83 | |||
84 | # | ||
85 | # Report status based on result code | ||
86 | # | ||
87 | result=$? | ||
88 | if [ "$PROGRESS" = yes ]; then | ||
89 | if [ "$result" = 0 ]; then | ||
90 | echo "=s" >/proc/progress | ||
91 | else | ||
92 | echo "=f" >/proc/progress | ||
93 | fi | ||
94 | fi | ||
95 | done | ||
96 | |||
97 | # | ||
98 | # For compatibility, run the files in /etc/rc.boot too. | ||
99 | # | ||
100 | [ -d /etc/rc.boot ] && run-parts /etc/rc.boot | ||
101 | |||
102 | # | ||
103 | # Finish setup if needed. The comment above about | ||
104 | # /sbin/unconfigured.sh applies here as well! | ||
105 | # | ||
106 | if [ -x /sbin/setup.sh ] | ||
107 | then | ||
108 | /sbin/setup.sh | ||
109 | fi | ||
110 | |||
diff --git a/meta/packages/sysvinit/sysvinit/rcS-default b/meta/packages/sysvinit/sysvinit/rcS-default new file mode 100644 index 0000000000..46e48b9796 --- /dev/null +++ b/meta/packages/sysvinit/sysvinit/rcS-default | |||
@@ -0,0 +1,21 @@ | |||
1 | # | ||
2 | # Defaults for the boot scripts in /etc/rcS.d | ||
3 | # | ||
4 | |||
5 | # Time files in /tmp are kept in days. | ||
6 | TMPTIME=0 | ||
7 | # Set to yes if you want sulogin to be spawned on bootup | ||
8 | SULOGIN=no | ||
9 | # Set to no if you want to be able to login over telnet/rlogin | ||
10 | # before system startup is complete (as soon as inetd is started) | ||
11 | DELAYLOGIN=no | ||
12 | # Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not. | ||
13 | # UTC=yes | ||
14 | # Set VERBOSE to "no" if you would like a more quiet bootup. | ||
15 | VERBOSE=no | ||
16 | # Set EDITMOTD to "no" if you don't want /etc/motd to be editted automatically | ||
17 | EDITMOTD=no | ||
18 | # Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup. | ||
19 | FSCKFIX=yes | ||
20 | # Set TICKADJ to the correct tick value for this specific machine | ||
21 | #TICKADJ=10000 | ||