diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/inittab | 47 | ||||
-rwxr-xr-x | examples/udhcp/simple.script | 5 |
2 files changed, 33 insertions, 19 deletions
diff --git a/examples/inittab b/examples/inittab index 01ceaef25..4761aa19c 100644 --- a/examples/inittab +++ b/examples/inittab | |||
@@ -19,30 +19,43 @@ | |||
19 | # | 19 | # |
20 | # <runlevels>: The runlevels field is completely ignored. | 20 | # <runlevels>: The runlevels field is completely ignored. |
21 | # | 21 | # |
22 | # <action>: Valid actions include: sysinit, respawn, askfirst, wait, once, | 22 | # <action>: Valid actions include: sysinit, wait, once, respawn, askfirst, |
23 | # restart, ctrlaltdel, and shutdown. | 23 | # shutdown, restart and ctrlaltdel. |
24 | # | 24 | # |
25 | # Note: askfirst acts just like respawn, but before running the specified | 25 | # sysinit actions are started first, and init waits for them to complete. |
26 | # process it displays the line "Please press Enter to activate this | 26 | # wait actions are started next, and init waits for them to complete. |
27 | # console." and then waits for the user to press enter before starting | 27 | # once actions are started next (and not waited for). |
28 | # the specified process. | ||
29 | # | 28 | # |
30 | # Note: unrecognized actions (like initdefault) will cause init to emit | 29 | # askfirst and respawn are started next. |
31 | # an error message, and then go along with its business. | 30 | # For askfirst, before running the specified process, init displays |
31 | # the line "Please press Enter to activate this console" | ||
32 | # and then waits for the user to press enter before starting it. | ||
33 | # | ||
34 | # shutdown actions are run on halt/reboot/poweroff, or on SIGQUIT. | ||
35 | # Then the machine is halted/rebooted/powered off, or for SIGQUIT, | ||
36 | # restart action is exec'ed (init process is replaced by that process). | ||
37 | # If no restart action specified, SIGQUIT has no effect. | ||
38 | # | ||
39 | # ctrlaltdel actions are run when SIGINT is received | ||
40 | # (this might be initiated by Ctrl-Alt-Del key combination). | ||
41 | # After they complete, normal processing of askfirst / respawn resumes. | ||
42 | # | ||
43 | # Note: unrecognized actions (like initdefault) will cause init to emit | ||
44 | # an error message, and then go along with its business. | ||
32 | # | 45 | # |
33 | # <process>: Specifies the process to be executed and it's command line. | 46 | # <process>: Specifies the process to be executed and it's command line. |
34 | # | 47 | # |
35 | # Note: BusyBox init works just fine without an inittab. If no inittab is | 48 | # Note: BusyBox init works just fine without an inittab. If no inittab is |
36 | # found, it has the following default behavior: | 49 | # found, it has the following default behavior: |
37 | # ::sysinit:/etc/init.d/rcS | 50 | # ::sysinit:/etc/init.d/rcS |
38 | # ::askfirst:/bin/sh | 51 | # ::askfirst:/bin/sh |
39 | # ::ctrlaltdel:/sbin/reboot | 52 | # ::ctrlaltdel:/sbin/reboot |
40 | # ::shutdown:/sbin/swapoff -a | 53 | # ::shutdown:/sbin/swapoff -a |
41 | # ::shutdown:/bin/umount -a -r | 54 | # ::shutdown:/bin/umount -a -r |
42 | # ::restart:/sbin/init | 55 | # ::restart:/sbin/init |
43 | # tty2::askfirst:/bin/sh | 56 | # tty2::askfirst:/bin/sh |
44 | # tty3::askfirst:/bin/sh | 57 | # tty3::askfirst:/bin/sh |
45 | # tty4::askfirst:/bin/sh | 58 | # tty4::askfirst:/bin/sh |
46 | # | 59 | # |
47 | # Boot-time system configuration/initialization script. | 60 | # Boot-time system configuration/initialization script. |
48 | # This is run first except when booting in single-user mode. | 61 | # This is run first except when booting in single-user mode. |
diff --git a/examples/udhcp/simple.script b/examples/udhcp/simple.script index 53974e6d6..6658fbeef 100755 --- a/examples/udhcp/simple.script +++ b/examples/udhcp/simple.script | |||
@@ -16,9 +16,10 @@ BROADCAST="broadcast +" | |||
16 | 16 | ||
17 | case "$1" in | 17 | case "$1" in |
18 | deconfig) | 18 | deconfig) |
19 | echo "Setting IP address 0.0.0.0 on $interface" | 19 | echo "Clearing IP addresses on $interface, upping it" |
20 | if command -v ip >/dev/null; then | 20 | if command -v ip >/dev/null; then |
21 | ip addr flush dev $interface | 21 | ip addr flush dev $interface |
22 | ip link set dev $interface up | ||
22 | else | 23 | else |
23 | ifconfig $interface 0.0.0.0 | 24 | ifconfig $interface 0.0.0.0 |
24 | fi | 25 | fi |
@@ -52,7 +53,6 @@ case "$1" in | |||
52 | done | 53 | done |
53 | fi | 54 | fi |
54 | 55 | ||
55 | echo "Recreating $RESOLV_CONF" | ||
56 | # If the file is a symlink somewhere (like /etc/resolv.conf | 56 | # If the file is a symlink somewhere (like /etc/resolv.conf |
57 | # pointing to /run/resolv.conf), make sure things work. | 57 | # pointing to /run/resolv.conf), make sure things work. |
58 | if test -L "$RESOLV_CONF"; then | 58 | if test -L "$RESOLV_CONF"; then |
@@ -60,6 +60,7 @@ case "$1" in | |||
60 | test -e "$RESOLV_CONF" || touch "$RESOLV_CONF" | 60 | test -e "$RESOLV_CONF" || touch "$RESOLV_CONF" |
61 | fi | 61 | fi |
62 | realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") | 62 | realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") |
63 | echo "Recreating $realconf" | ||
63 | tmpfile="$realconf-$$" | 64 | tmpfile="$realconf-$$" |
64 | > "$tmpfile" | 65 | > "$tmpfile" |
65 | [ -n "$domain" ] && echo "search $domain" >> "$tmpfile" | 66 | [ -n "$domain" ] && echo "search $domain" >> "$tmpfile" |