/[baselayout]/trunk/init.d/bootmisc
Gentoo

Contents of /trunk/init.d/bootmisc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 884 - (show annotations) (download)
Sun Jan 30 21:23:10 2005 UTC (14 years, 3 months ago) by vapier
File size: 2645 byte(s)
style updates

1 #!/sbin/runscript
2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6 depend() {
7 use clock hostname
8 need localmount
9 before logger
10 }
11
12 start() {
13 if [[ ${BOOT} == "yes" ]] ; then
14 #
15 # Put a nologin file in /etc to prevent people from logging in before
16 # system startup is complete.
17 #
18 if [[ ${DELAYLOGIN} == "yes" ]] ; then
19 echo "System bootup in progress - please wait" > /etc/nologin
20 cp /etc/nologin /etc/nologin.boot &> /dev/null
21 fi
22
23 if [[ -e /etc/sysctl.conf ]] ; then
24 ebegin "Configuring kernel parameters"
25 /sbin/sysctl -p /etc/sysctl.conf &> /dev/null
26 eend 0
27 fi
28
29 if [[ -z ${CDBOOT} ]] && ! touch /var/run/.keep 2> /dev/null ; then
30 ewarn "Skipping /var and /tmp initialization (ro root?)"
31 return 0
32 fi
33
34 if [[ -x /sbin/env-update.sh ]] ; then
35 ebegin "Updating environment"
36 /sbin/env-update.sh -u > /dev/null
37 eend 0
38 fi
39
40 #
41 # Take care of random stuff [ /var/lock | /var/run | pam ]
42 #
43 ebegin "Cleaning /var/lock, /var/run"
44 rm -rf /var/run/console.lock /var/run/console/*
45 if [[ -z ${CDBOOT} ]] ; then
46 #
47 # Clean up any stale locks.
48 #
49 find /var/lock -type f -print0 | xargs -0 rm -f --
50 #
51 # Clean up /var/run and create /var/run/utmp so that we can login.
52 #
53 for x in $(find /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed) ; do
54 local daemon=${x##*/}
55 daemon=${daemon%*.pid}
56 # Do not remove pidfiles of already running daemons
57 if [[ -z $(ps --no-heading -C "${daemon}") ]] ; then
58 if [[ -f ${x} || -L ${x} ]] ; then
59 rm -f "${x}"
60 fi
61 fi
62 done
63 fi
64 # Reset pam_console permissions
65 if [[ -x /sbin/pam_console_apply ]] && [[ ! -c /dev/.devfsd ]] ; 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