/[baselayout]/trunk/sbin/depscan.sh
Gentoo

Contents of /trunk/sbin/depscan.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1179 - (show annotations) (download) (as text)
Thu May 19 15:23:43 2005 UTC (14 years ago) by uberlord
File MIME type: text/x-sh
File size: 1505 byte(s)
Merged Paul Pacheco's parallel startup #69854 and modules update
#55329 patches

If RC_PARALLEL_STARTUP==yes then we no longer output einfo/ebegin
messages as they don't line up on screen correctly - instead we output
service ${myservice} starting/started/stopping/stopped/failed

1 #!/bin/bash
2 # Copyright 1999-2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6 source /etc/init.d/functions.sh
7
8 if [[ ! -d ${svcdir} ]]; then
9 if ! mkdir -p -m 0755 "${svcdir}" 2>/dev/null ; then
10 eerror "Could not create needed directory '${svcdir}'!"
11 fi
12 fi
13
14 for x in softscripts snapshot options \
15 started starting inactive stopping \
16 exclusive exitcodes ; do
17 if [[ ! -d "${svcdir}/${x}" ]]; then
18 if ! mkdir -p -m 0755 "${svcdir}/${x}" 2>/dev/null ; then
19 eerror "Could not create needed directory '${svcdir}/${x}'!"
20 fi
21 fi
22 done
23
24 # Only update if files have actually changed
25 update=1
26 if [[ $1 == "-u" ]]; then
27 update=0
28 for config in /etc/conf.d /etc/init.d /etc/rc.conf
29 do
30 if [[ ${config} -nt "${svcdir}/depcache" ]]; then
31 update=1
32 break
33 fi
34 done
35 shift
36 fi
37 [[ ${update} == 0 ]] && exit 0
38
39 ebegin "Caching service dependencies"
40
41 # Clean out the non volitile directories ...
42 rm -rf "${svcdir}"/dep{cache,tree} "${svcdir}"/{broken,snapshot}/*
43
44 retval=0
45 SVCDIR="${svcdir}"
46 DEPTYPES="${deptypes}"
47 ORDTYPES="${ordtypes}"
48
49 export SVCDIR DEPTYPES ORDTYPES
50
51 cd /etc/init.d
52
53 /bin/gawk \
54 -f /lib/rcscripts/awk/functions.awk \
55 -f /lib/rcscripts/awk/cachedepends.awk || \
56 retval=1
57
58 bash "${svcdir}/depcache" | \
59 /bin/gawk \
60 -f /lib/rcscripts/awk/functions.awk \
61 -f /lib/rcscripts/awk/gendepends.awk || \
62 retval=1
63
64 touch -m "${svcdir}"/dep{cache,tree}
65
66 eend ${retval} "Failed to cache service dependencies"
67
68 exit ${retval}
69
70 # 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