generate config files using mako
[invirt/packages/invirt-console.git] / files / etc / init.d / bootmisc.sh.sipb-xen
1 #!/bin/sh
2 ### BEGIN INIT INFO
3 # Provides:          bootmisc
4 # Required-Start:    $local_fs hostname $remote_fs
5 # Required-Stop:     $local_fs
6 # Default-Start:     S
7 # Default-Stop:
8 # Short-Description: Miscellaneous things to be done during bootup.
9 # Description:
10 ### END INIT INFO
11
12 PATH=/sbin:/usr/sbin:/bin:/usr/bin
13 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
14 . /lib/init/vars.sh
15
16 do_start () {
17         #
18         # If login delaying is enabled then create the flag file
19         # which prevents logins before startup is complete
20         #
21         case "$DELAYLOGIN" in
22           Y*|y*)
23                 echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
24                 ;;
25         esac
26
27         # Create /var/run/utmp so we can login.
28         : > /var/run/utmp
29         if grep -q ^utmp: /etc/group
30         then
31                 chmod 664 /var/run/utmp
32                 chgrp utmp /var/run/utmp
33         fi
34
35         # Set pseudo-terminal access permissions.
36         if [ ! -e /dev/.devfsd ] && [ -c /dev/ttyp0 ]
37         then
38                 chmod -f 666 /dev/tty[p-za-e][0-9a-f]
39                 chown -f root:tty /dev/tty[p-za-e][0-9a-f]
40         fi
41
42         # Do not update motd
43         #uname -snrvm > /var/run/motd
44         #[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
45         cp /etc/motd /var/run/motd
46
47         # Save kernel messages in /var/log/dmesg
48         if which dmesg >/dev/null 2>&1
49         then
50                 savelog -q -p -c 5 /var/log/dmesg
51                 dmesg -s 524288 > /var/log/dmesg
52                 chgrp adm /var/log/dmesg || :
53         elif [ -c /dev/klog ]
54         then
55                 savelog -q -p -c 5 /var/log/dmesg
56                 dd if=/dev/klog of=/var/log/dmesg &
57                 sleep 1
58                 kill $!
59                 [ -f /var/log/dmesg ] && { chgrp adm /var/log/dmesg || : ; }
60         fi
61
62         #
63         #       Save udev log in /var/log/udev
64         #
65         if [ -e /dev/.udev.log ]
66         then
67                 mv -f /dev/.udev.log /var/log/udev
68         fi
69
70         # Remove bootclean's flag files.
71         # Don't run bootclean again after this!
72         rm -f /tmp/.clean /var/run/.clean /var/lock/.clean
73 }
74
75 case "$1" in
76   start|"")
77         do_start
78         ;;
79   restart|reload|force-reload)
80         echo "Error: argument '$1' not supported" >&2
81         exit 3
82         ;;
83   stop)
84         # No-op
85         ;;
86   *)
87         echo "Usage: bootmisc.sh [start|stop]" >&2
88         exit 3
89         ;;
90 esac
91
92 :