/[baselayout]/branches/rc-scripts-1_6/init.d/bootmisc
Gentoo

Contents of /branches/rc-scripts-1_6/init.d/bootmisc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1231 - (show annotations) (download)
Mon Jun 13 02:25:31 2005 UTC (9 years, 1 month ago) by vapier
File size: 2727 byte(s)
merge cvs Header removal from trunk
1 #!/sbin/runscript
2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 depend() {
6 use clock hostname
7 need localmount
8 before logger
9 }
10
11 start() {
12 if [[ ${BOOT} == "yes" ]] ; then
13 #
14 # Put a nologin file in /etc to prevent people from logging in before
15 # system startup is complete.
16 #
17 if [[ ${DELAYLOGIN} == "yes" ]] ; then
18 echo "System bootup in progress - please wait" > /etc/nologin
19 cp /etc/nologin /etc/nologin.boot &> /dev/null
20 fi
21
22 if [[ -e /etc/sysctl.conf ]] ; then
23 ebegin "Configuring kernel parameters"
24 /sbin/sysctl -q -p /etc/sysctl.conf
25 eend 0
26 fi
27
28 if [[ -z ${CDBOOT} ]] && ! touch /var/run/.keep 2> /dev/null ; then
29 ewarn "Skipping /var and /tmp initialization (ro root?)"
30 return 0
31 fi
32
33 if [[ -x /sbin/env-update.sh ]] ; then
34 ebegin "Updating environment"
35 /sbin/env-update.sh -u > /dev/null
36 eend 0
37 fi
38
39 #
40 # Take care of random stuff [ /var/lock | /var/run | pam ]
41 #
42 ebegin "Cleaning /var/lock, /var/run"
43 rm -rf /var/run/console.lock /var/run/console/*
44 if [[ -z ${CDBOOT} ]] ; then
45 #
46 # Clean up any stale locks.
47 #
48 find /var/lock -type f -print0 | xargs -0 rm -f --
49 #
50 # Clean up /var/run and create /var/run/utmp so that we can login.
51 #
52 for x in $(find /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed) ; do
53 local daemon=${x##*/}
54 daemon=${daemon%*.pid}
55 # Do not remove pidfiles of already running daemons
56 if [[ -z $(ps --no-heading -C "${daemon}") ]] ; then
57 if [[ -f ${x} || -L ${x} ]] ; then
58 rm -f "${x}"
59 fi
60 fi
61 done
62 fi
63 # Reset pam_console permissions if we are actually using it
64 if [[ -x /sbin/pam_console_apply && ! -c /dev/.devfsd && \
65 -n $(grep -v -e '^[[:space:]]*#' /etc/pam.d/* | grep 'pam_console') ]] ; then
66 /sbin/pam_console_apply -r
67 fi
68 # Create the .keep to stop portage from removing /var/lock
69 > /var/lock/.keep
70 eend 0
71
72 #
73 # Clean up /tmp directory
74 #
75 if [[ -z ${CDBOOT} ]] ; then
76 ebegin "Cleaning /tmp directory"
77 rm -f /tmp/.X*-lock /tmp/esrv* /tmp/kio* /tmp/jpsock.* /tmp/.fam* &> /dev/null
78 rm -rf /tmp/.esd* /tmp/orbit-* /tmp/ssh-* /tmp/ksocket-* /tmp/.*-unix &> /dev/null
79 # Make sure our X11 stuff have the correct permissions
80 mkdir -p /tmp/.{ICE,X11}-unix &> /dev/null
81 # chown root.root /tmp/.{ICE,X11}-unix &> /dev/null
82 chmod 1777 /tmp/.{ICE,X11}-unix &> /dev/null
83 eend 0
84 fi
85
86 #
87 # Create an 'after-boot' dmesg log
88 #
89 touch /var/log/dmesg
90 chmod 640 /var/log/dmesg
91 dmesg > /var/log/dmesg
92 fi
93
94 #
95 # Check for /etc/resolv.conf, and create if missing
96 #
97 [[ -f /etc/resolv.conf ]] || touch /etc/resolv.conf &> /dev/null
98 }
99
100
101 # vim:ts=4

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20