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

Contents of /trunk/init.d/bootmisc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 484 - (show annotations) (download)
Wed Apr 21 17:09:18 2004 UTC (15 years, 2 months ago) by vapier
File size: 2716 byte(s)
update copyright years

1 #!/sbin/runscript
2 # Copyright 1999-2004 Gentoo Technologies, Inc.
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6 depend() {
7 need clock localmount hostname
8 before logger
9 }
10
11 start() {
12 if [ "${BOOT}" = "yes" ]
13 then
14 # Put a nologin file in /etc to prevent people from logging in before
15 # system startup is complete.
16 if [ "${DELAYLOGIN}" = "yes" ]
17 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 ]
23 then
24 ebegin "Configuring kernel parameters"
25 /sbin/sysctl -p /etc/sysctl.conf &>/dev/null
26 eend 0
27 fi
28
29 if [ -x /sbin/env-update.sh ]
30 then
31 ebegin "Updating environment"
32 /sbin/env-update.sh >/dev/null
33 eend 0
34 fi
35
36 # Reset pam_console permissions
37 rm -rf /var/run/console.lock /var/run/console/*
38 if [ -z "${CDBOOT}" ]
39 then
40 #
41 # Clean up any stale locks.
42 #
43 ebegin "Cleaning /var/lock, /var/run"
44 ( find /var/lock -type f -exec rm -f -- {} \; )
45
46 #
47 # Clean up /var/run and create /var/run/utmp so that we can login.
48 #
49 for x in $(find /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed)
50 do
51 local daemon="${x##*/}"
52 daemon="${daemon%*.pid}"
53 # Do not remove pidfiles of already running daemons
54 if [ -z "`ps --no-heading -C "${daemon}"`" ]
55 then
56 if [ -f "${x}" -o -L "${x}" ]
57 then
58 rm -f "${x}"
59 fi
60 fi
61 done
62 fi
63 # Setup login records
64 > /var/run/utmp
65 touch /var/log/wtmp
66 chgrp utmp /var/run/utmp /var/log/wtmp
67 chmod 0664 /var/run/utmp /var/log/wtmp
68 # Remove /var/run/utmpx (bug from the past)
69 rm -f /var/run/utmpx
70 # Reset pam_console permissions
71 [ -x /sbin/pam_console_apply -a ! -c /dev/.devfsd ] && \
72 /sbin/pam_console_apply -r
73 # Create the .keep to stop portage from removing /var/lock
74 >/var/lock/.keep
75 eend 0
76
77 #
78 # Clean up /tmp directory
79 #
80 if [ -z "${CDBOOT}" ]
81 then
82 ebegin "Cleaning /tmp directory"
83 rm -f /tmp/.X*-lock /tmp/esrv* /tmp/kio* /tmp/jpsock.* /tmp/.fam* &>/dev/null
84 rm -rf /tmp/.esd* /tmp/orbit-* /tmp/ssh-* /tmp/ksocket-* /tmp/.*-unix &>/dev/null
85 # Make sure our X11 stuff have the correct permissions
86 mkdir -p /tmp/.{ICE,X11}-unix &>/dev/null
87 # chown root.root /tmp/.{ICE,X11}-unix &>/dev/null
88 chmod 1777 /tmp/.{ICE,X11}-unix &>/dev/null
89 eend 0
90 fi
91 fi
92
93 #
94 # Check for /etc/resolv.conf, and create if missing
95 #
96 [ -f /etc/resolv.conf ] || touch /etc/resolv.conf &>/dev/null
97
98 # This should be handled by devfsd ...
99 # if test -c /dev/ttyp0 &>/dev/null
100 # then
101 # chmod 666 /dev/tty[p-za-e][0-9a-f] &>/dev/null
102 # chown root:tty /dev/tty[p-za-e][0-9a-f] &>/dev/null
103 # fi
104 }
105
106
107 # 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