1 |
Author: grobian |
2 |
Date: 2011-03-31 14:12:12 +0000 (Thu, 31 Mar 2011) |
3 |
New Revision: 1686 |
4 |
|
5 |
Modified: |
6 |
trunk/baselayout-prefix/etc/env.d/00basic |
7 |
trunk/baselayout-prefix/etc/profile |
8 |
trunk/baselayout-prefix/sbin/env-update.sh |
9 |
trunk/baselayout-prefix/sbin/functions.sh |
10 |
trunk/baselayout-prefix/sbin/runscript.sh |
11 |
Log: |
12 |
applied baselayout-1.12.5-prefix.patch |
13 |
|
14 |
Modified: trunk/baselayout-prefix/etc/env.d/00basic |
15 |
=================================================================== |
16 |
--- trunk/baselayout-prefix/etc/env.d/00basic 2011-03-31 14:11:59 UTC (rev 1685) |
17 |
+++ trunk/baselayout-prefix/etc/env.d/00basic 2011-03-31 14:12:12 UTC (rev 1686) |
18 |
@@ -1,10 +1,11 @@ |
19 |
-# /etc/env.d/00basic |
20 |
+# @GENTOO_PORTAGE_EPREFIX@/etc/env.d/00basic |
21 |
|
22 |
-PATH="/opt/bin" |
23 |
-ROOTPATH="/opt/bin" |
24 |
-LDPATH="/usr/local/lib" |
25 |
-MANPATH="/usr/local/share/man:/usr/share/man" |
26 |
-INFOPATH="/usr/share/info" |
27 |
+# in prefix we have sbin variants in user path! |
28 |
+PATH="@GENTOO_PORTAGE_EPREFIX@/opt/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/sbin" |
29 |
+ROOTPATH="@GENTOO_PORTAGE_EPREFIX@/opt/bin" |
30 |
+LDPATH="@GENTOO_PORTAGE_EPREFIX@/usr/local/lib" |
31 |
+MANPATH="@GENTOO_PORTAGE_EPREFIX@/usr/share/man" |
32 |
+INFOPATH="@GENTOO_PORTAGE_EPREFIX@/usr/share/info" |
33 |
CVS_RSH="ssh" |
34 |
-PAGER="/usr/bin/less" |
35 |
+PAGER="@GENTOO_PORTAGE_EPREFIX@/usr/bin/less" |
36 |
LESSOPEN="|lesspipe.sh %s" |
37 |
|
38 |
Modified: trunk/baselayout-prefix/etc/profile |
39 |
=================================================================== |
40 |
--- trunk/baselayout-prefix/etc/profile 2011-03-31 14:11:59 UTC (rev 1685) |
41 |
+++ trunk/baselayout-prefix/etc/profile 2011-03-31 14:12:12 UTC (rev 1686) |
42 |
@@ -1,4 +1,4 @@ |
43 |
-# /etc/profile: login shell setup |
44 |
+# @GENTOO_PORTAGE_EPREFIX@/etc/profile: login shell setup |
45 |
# |
46 |
# That this file is used by any Bourne-shell derivative to setup the |
47 |
# environment for login shells. |
48 |
@@ -6,8 +6,8 @@ |
49 |
|
50 |
# Load environment settings from profile.env, which is created by |
51 |
# env-update from the files in /etc/env.d |
52 |
-if [ -e /etc/profile.env ] ; then |
53 |
- . /etc/profile.env |
54 |
+if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then |
55 |
+ . "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env |
56 |
fi |
57 |
|
58 |
# 077 would be more secure, but 022 is generally quite realistic |
59 |
@@ -22,23 +22,23 @@ |
60 |
# This way the evaluation can be short-circuited and calling whoami is |
61 |
# avoided. |
62 |
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then |
63 |
- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}" |
64 |
+ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin" |
65 |
else |
66 |
- PATH="/usr/local/bin:/usr/bin:/bin:${PATH}" |
67 |
+ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin" |
68 |
fi |
69 |
export PATH |
70 |
unset ROOTPATH |
71 |
|
72 |
# Extract the value of EDITOR |
73 |
-[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`" |
74 |
-[ -z "$EDITOR" ] && EDITOR="/bin/nano" |
75 |
+[ -z "$EDITOR" ] && EDITOR="`. @GENTOO_PORTAGE_EPREFIX@/etc/rc.conf 2>/dev/null; echo $EDITOR`" |
76 |
+[ -z "$EDITOR" ] && EDITOR="@GENTOO_PORTAGE_EPREFIX@/bin/nano" |
77 |
export EDITOR |
78 |
|
79 |
if [ -n "${BASH_VERSION}" ] ; then |
80 |
# Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 |
81 |
# including color. We leave out color here because not all |
82 |
# terminals support it. |
83 |
- if [ -f /etc/bash/bashrc ] ; then |
84 |
+ if [ -f "@GENTOO_PORTAGE_EPREFIX@"/etc/bash/bashrc ] ; then |
85 |
# Bash login shells run only /etc/profile |
86 |
# Bash non-login shells run only /etc/bash/bashrc |
87 |
# Since we want to run /etc/bash/bashrc regardless, we source it |
88 |
@@ -46,7 +46,7 @@ |
89 |
# this *after* the user's .bash_profile runs (without putting |
90 |
# it in the user's dot-files), but it shouldn't make any |
91 |
# difference. |
92 |
- . /etc/bash/bashrc |
93 |
+ . "@GENTOO_PORTAGE_EPREFIX@"/etc/bash/bashrc |
94 |
else |
95 |
PS1='\u@\h \w \$ ' |
96 |
fi |
97 |
@@ -57,7 +57,7 @@ |
98 |
PS1="`whoami`@`uname -n | cut -f1 -d.` \$ " |
99 |
fi |
100 |
|
101 |
-for sh in /etc/profile.d/*.sh ; do |
102 |
+for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do |
103 |
if [ -r "$sh" ] ; then |
104 |
. "$sh" |
105 |
fi |
106 |
|
107 |
Modified: trunk/baselayout-prefix/sbin/env-update.sh |
108 |
=================================================================== |
109 |
--- trunk/baselayout-prefix/sbin/env-update.sh 2011-03-31 14:11:59 UTC (rev 1685) |
110 |
+++ trunk/baselayout-prefix/sbin/env-update.sh 2011-03-31 14:12:12 UTC (rev 1686) |
111 |
@@ -1,10 +1,10 @@ |
112 |
-#!/bin/bash |
113 |
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash |
114 |
# Copyright 1999-2004 Gentoo Foundation |
115 |
# Distributed under the terms of the GNU General Public License v2 |
116 |
|
117 |
-source /sbin/functions.sh || exit 1 |
118 |
+source "@GENTOO_PORTAGE_EPREFIX@"/sbin/functions.sh || exit 1 |
119 |
|
120 |
-if [[ ${EUID} != "0" ]] ; then |
121 |
+if [[ ${EPREFIX/\//} == "" ]] && [[ ${EUID} != "0" ]] ; then |
122 |
eerror "$0: must be root." |
123 |
exit 1 |
124 |
fi |
125 |
@@ -13,8 +13,8 @@ |
126 |
echo "usage: env-update.sh |
127 |
|
128 |
note: |
129 |
- This utility generates /etc/profile.env and /etc/csh.env |
130 |
- from the contents of /etc/env.d/ |
131 |
+ This utility generates @GENTOO_PORTAGE_EPREFIX@/etc/profile.env and @GENTOO_PORTAGE_EPREFIX@/etc/csh.env |
132 |
+ from the contents of @GENTOO_PORTAGE_EPREFIX@/etc/env.d/ |
133 |
" |
134 |
exit 1 |
135 |
} |
136 |
@@ -30,9 +30,9 @@ |
137 |
if [[ $# != "0" ]] ; then |
138 |
usage |
139 |
else |
140 |
- /bin/gawk \ |
141 |
- -f /lib/rcscripts/awk/functions.awk \ |
142 |
- -f /lib/rcscripts/awk/genenviron.awk |
143 |
+ "@GENTOO_PORTAGE_EPREFIX@"/bin/gawk \ |
144 |
+ -f "@GENTOO_PORTAGE_EPREFIX@"/lib/rcscripts/awk/functions.awk \ |
145 |
+ -f "@GENTOO_PORTAGE_EPREFIX@"/lib/rcscripts/awk/genenviron.awk |
146 |
fi |
147 |
|
148 |
# vim:ts=4 |
149 |
|
150 |
Modified: trunk/baselayout-prefix/sbin/functions.sh |
151 |
=================================================================== |
152 |
--- trunk/baselayout-prefix/sbin/functions.sh 2011-03-31 14:11:59 UTC (rev 1685) |
153 |
+++ trunk/baselayout-prefix/sbin/functions.sh 2011-03-31 14:12:12 UTC (rev 1686) |
154 |
@@ -4,11 +4,11 @@ |
155 |
RC_GOT_FUNCTIONS="yes" |
156 |
|
157 |
# Override defaults with user settings ... |
158 |
-[[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc |
159 |
+[[ -f @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/rc ]] && source "@GENTOO_PORTAGE_EPREFIX@"/etc/conf.d/rc |
160 |
|
161 |
# Check /etc/conf.d/rc for a description of these ... |
162 |
-declare -r svclib="/lib/rcscripts" |
163 |
-declare -r svcdir="${svcdir:-/var/lib/init.d}" |
164 |
+declare -r svclib="@GENTOO_PORTAGE_EPREFIX@/lib/rcscripts" |
165 |
+declare -r svcdir="${svcdir:-@GENTOO_PORTAGE_EPREFIX@/var/lib/init.d}" |
166 |
svcmount="${svcmount:-no}" |
167 |
svcfstype="${svcfstype:-tmpfs}" |
168 |
svcsize="${svcsize:-1024}" |
169 |
@@ -83,7 +83,7 @@ |
170 |
} |
171 |
# This will override the splash() function... |
172 |
if ! import_addon splash-functions.sh ; then |
173 |
- [[ -f /sbin/splash-functions.sh ]] && source /sbin/splash-functions.sh |
174 |
+ [[ -f @GENTOO_PORTAGE_EPREFIX@/sbin/splash-functions.sh ]] && source "@GENTOO_PORTAGE_EPREFIX@"/sbin/splash-functions.sh |
175 |
fi |
176 |
|
177 |
# void profiling(...) |
178 |
@@ -114,8 +114,8 @@ |
179 |
local newbootlevel= |
180 |
local newsoftlevel= |
181 |
|
182 |
- if [[ -r /proc/cmdline ]] ; then |
183 |
- for copt in $(</proc/cmdline) ; do |
184 |
+ if [[ -r @GENTOO_PORTAGE_EPREFIX@/proc/cmdline ]] ; then |
185 |
+ for copt in $(<"@GENTOO_PORTAGE_EPREFIX@"/proc/cmdline) ; do |
186 |
case "${copt%=*}" in |
187 |
bootlevel) |
188 |
newbootlevel="${copt##*=}" |
189 |
@@ -153,8 +153,8 @@ |
190 |
fi |
191 |
|
192 |
if [[ ${RC_USE_CONFIG_PROFILE} == "yes" && -n ${DEFAULTLEVEL} ]] && \ |
193 |
- [[ -d "/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" || \ |
194 |
- -L "/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" ]] ; then |
195 |
+ [[ -d "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" || \ |
196 |
+ -L "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" ]] ; then |
197 |
export BOOTLEVEL="${BOOTLEVEL}.${DEFAULTLEVEL}" |
198 |
fi |
199 |
|
200 |
@@ -176,8 +176,8 @@ |
201 |
get_libdir() { |
202 |
if [[ -n ${CONF_LIBDIR_OVERRIDE} ]] ; then |
203 |
CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}" |
204 |
- elif [[ -x /usr/bin/portageq ]] ; then |
205 |
- CONF_LIBDIR="$(/usr/bin/portageq envvar CONF_LIBDIR)" |
206 |
+ elif [[ -x @GENTOO_PORTAGE_EPREFIX@/usr/bin/portageq ]] ; then |
207 |
+ CONF_LIBDIR="$("@GENTOO_PORTAGE_EPREFIX@"/usr/bin/portageq envvar CONF_LIBDIR)" |
208 |
fi |
209 |
echo "${CONF_LIBDIR:=lib}" |
210 |
} |
211 |
@@ -190,14 +190,14 @@ |
212 |
local pri= |
213 |
local tag= |
214 |
|
215 |
- if [[ -x /usr/bin/logger ]] ; then |
216 |
+ if [[ -x @GENTOO_PORTAGE_EPREFIX@/usr/bin/logger ]] ; then |
217 |
pri="$1" |
218 |
tag="$2" |
219 |
|
220 |
shift 2 |
221 |
[[ -z "$*" ]] && return 0 |
222 |
|
223 |
- /usr/bin/logger -p "${pri}" -t "${tag}" -- "$*" |
224 |
+ "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/logger -p "${pri}" -t "${tag}" -- "$*" |
225 |
fi |
226 |
|
227 |
return 0 |
228 |
@@ -269,7 +269,7 @@ |
229 |
fi |
230 |
|
231 |
local name="rc-scripts" |
232 |
- [[ $0 != "/sbin/runscript.sh" ]] && name="${0##*/}" |
233 |
+ [[ $0 != "@GENTOO_PORTAGE_EPREFIX@/sbin/runscript.sh" ]] && name="${0##*/}" |
234 |
# Log warnings to system log |
235 |
esyslog "daemon.warning" "${name}" "$*" |
236 |
|
237 |
@@ -290,7 +290,7 @@ |
238 |
fi |
239 |
|
240 |
local name="rc-scripts" |
241 |
- [[ $0 != "/sbin/runscript.sh" ]] && name="${0##*/}" |
242 |
+ [[ $0 != "@GENTOO_PORTAGE_EPREFIX@/sbin/runscript.sh" ]] && name="${0##*/}" |
243 |
# Log errors to system log |
244 |
esyslog "daemon.err" "rc-scripts" "$*" |
245 |
|
246 |
@@ -488,9 +488,9 @@ |
247 |
get_bootparam() { |
248 |
local x copt params retval=1 |
249 |
|
250 |
- [[ ! -r /proc/cmdline ]] && return 1 |
251 |
+ [[ ! -r @GENTOO_PORTAGE_EPREFIX@/proc/cmdline ]] && return 1 |
252 |
|
253 |
- for copt in $(< /proc/cmdline) ; do |
254 |
+ for copt in $(< "@GENTOO_PORTAGE_EPREFIX@"/proc/cmdline) ; do |
255 |
if [[ ${copt%=*} == "gentoo" ]] ; then |
256 |
params=$(gawk -v PARAMS="${copt##*=}" ' |
257 |
BEGIN { |
258 |
@@ -583,8 +583,8 @@ |
259 |
# get the version of baselayout that this system is running |
260 |
# |
261 |
get_base_ver() { |
262 |
- [[ ! -r /etc/gentoo-release ]] && return 0 |
263 |
- local ver="$(</etc/gentoo-release)" |
264 |
+ [[ ! -r @GENTOO_PORTAGE_EPREFIX@/etc/gentoo-release ]] && return 0 |
265 |
+ local ver="$(<"@GENTOO_PORTAGE_EPREFIX@"/etc/gentoo-release)" |
266 |
echo "${ver##* }" |
267 |
} |
268 |
|
269 |
@@ -602,8 +602,8 @@ |
270 |
is_net_fs() { |
271 |
local fstype |
272 |
# /proc/mounts is always accurate but may not always be available |
273 |
- if [[ -e /proc/mounts ]] ; then |
274 |
- fstype="$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' /proc/mounts )" |
275 |
+ if [[ -e @GENTOO_PORTAGE_EPREFIX@/proc/mounts ]] ; then |
276 |
+ fstype="$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' "@GENTOO_PORTAGE_EPREFIX@"/proc/mounts )" |
277 |
else |
278 |
fstype="$( mount | sed -n -e 's:.* on '"$1"' type \([^ ]*\).*:\1:p' )" |
279 |
fi |
280 |
@@ -618,7 +618,7 @@ |
281 |
# EXAMPLE: if is_union_fs / ; then ... |
282 |
# |
283 |
is_union_fs() { |
284 |
- [[ ! -x /sbin/unionctl ]] && return 1 |
285 |
+ [[ ! -x @GENTOO_PORTAGE_EPREFIX@/sbin/unionctl ]] && return 1 |
286 |
unionctl "$1" --list &>/dev/null |
287 |
} |
288 |
|
289 |
@@ -629,7 +629,7 @@ |
290 |
# EXAMPLE: if is_uml_sys ; then ... |
291 |
# |
292 |
is_uml_sys() { |
293 |
- grep -qs 'UML' /proc/cpuinfo |
294 |
+ grep -qs 'UML' "@GENTOO_PORTAGE_EPREFIX@"/proc/cpuinfo |
295 |
} |
296 |
|
297 |
# bool is_vserver_sys() |
298 |
@@ -639,7 +639,7 @@ |
299 |
# EXAMPLE: if is_vserver_sys ; then ... |
300 |
# |
301 |
is_vserver_sys() { |
302 |
- grep -qs '^s_context:[[:space:]]*[1-9]' /proc/self/status |
303 |
+ grep -qs '^s_context:[[:space:]]*[1-9]' "@GENTOO_PORTAGE_EPREFIX@"/proc/self/status |
304 |
} |
305 |
|
306 |
# bool is_xenU_sys() |
307 |
@@ -649,9 +649,9 @@ |
308 |
# EXAMPLE: if is_xenU_sys ; then ... |
309 |
# |
310 |
is_xenU_sys() { |
311 |
- [[ ! -d /proc/xen ]] && return 1 |
312 |
- [[ ! -r /proc/xen/capabilities ]] && return 1 |
313 |
- grep -q "control_d" /proc/xen/capabilities && return 1 |
314 |
+ [[ ! -d "@GENTOO_PORTAGE_EPREFIX@"/proc/xen ]] && return 1 |
315 |
+ [[ ! -r "@GENTOO_PORTAGE_EPREFIX@"/proc/xen/capabilities ]] && return 1 |
316 |
+ grep -q "control_d" "@GENTOO_PORTAGE_EPREFIX@"/proc/xen/capabilities && return 1 |
317 |
return 0 |
318 |
} |
319 |
|
320 |
@@ -667,7 +667,7 @@ |
321 |
gawk '$1 ~ "^#" { next } |
322 |
$2 == "'$*'" { stab="-t "$3" -o "$4" "$1" "$2; } |
323 |
END { print stab; } |
324 |
- ' /etc/fstab |
325 |
+ ' "@GENTOO_PORTAGE_EPREFIX@"/etc/fstab |
326 |
} |
327 |
|
328 |
# char *reverse_list(list) |
329 |
@@ -771,13 +771,13 @@ |
330 |
# Setup a basic $PATH. Just add system default to existing. |
331 |
# This should solve both /sbin and /usr/sbin not present when |
332 |
# doing 'su -c foo', or for something like: PATH= rcscript start |
333 |
- PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:${PATH}" |
334 |
+ PATH="@GENTOO_PORTAGE_EPREFIX@/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/local/sbin:${PATH}" |
335 |
|
336 |
# Cache the CONSOLETYPE - this is important as backgrounded shells don't |
337 |
# have a TTY. rc unsets it at the end of running so it shouldn't hang |
338 |
# around |
339 |
if [[ -z ${CONSOLETYPE} ]] ; then |
340 |
- export CONSOLETYPE="$( /sbin/consoletype 2>/dev/null )" |
341 |
+ export CONSOLETYPE="$( "@GENTOO_PORTAGE_EPREFIX@"/sbin/consoletype 2>/dev/null )" |
342 |
fi |
343 |
if [[ ${CONSOLETYPE} == "serial" ]] ; then |
344 |
RC_NOCOLOR="yes" |
345 |
@@ -797,7 +797,7 @@ |
346 |
|
347 |
# If we are not /sbin/rc then ensure that we cannot change level variables |
348 |
if [[ -n ${BASH_SOURCE} \ |
349 |
- && ${BASH_SOURCE[${#BASH_SOURCE[@]}-1]} != "/sbin/rc" ]] ; then |
350 |
+ && ${BASH_SOURCE[${#BASH_SOURCE[@]}-1]} != "@GENTOO_PORTAGE_EPREFIX@/sbin/rc" ]] ; then |
351 |
declare -r BOOTLEVEL DEFAULTLEVEL SOFTLEVEL |
352 |
fi |
353 |
else |
354 |
|
355 |
Modified: trunk/baselayout-prefix/sbin/runscript.sh |
356 |
=================================================================== |
357 |
--- trunk/baselayout-prefix/sbin/runscript.sh 2011-03-31 14:11:59 UTC (rev 1685) |
358 |
+++ trunk/baselayout-prefix/sbin/runscript.sh 2011-03-31 14:12:12 UTC (rev 1686) |
359 |
@@ -1,18 +1,18 @@ |
360 |
-#!/bin/bash |
361 |
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash |
362 |
# Copyright 1999-2006 Gentoo Foundation |
363 |
# Distributed under the terms of the GNU General Public License v2 |
364 |
|
365 |
# Common functions |
366 |
-[[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source /sbin/functions.sh |
367 |
+[[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source @GENTOO_PORTAGE_EPREFIX@/sbin/functions.sh |
368 |
|
369 |
-# User must be root to run most script stuff (except status) |
370 |
-if [[ ${EUID} != "0" ]] && ! [[ $2 == "status" && $# -eq 2 ]] ; then |
371 |
- eerror "$0: must be root to run init scripts" |
372 |
- exit 1 |
373 |
-fi |
374 |
+## User must be root to run most script stuff (except status) |
375 |
+#if [[ ${EUID} != "0" ]] && ! [[ $2 == "status" && $# -eq 2 ]] ; then |
376 |
+# eerror "$0: must be root to run init scripts" |
377 |
+# exit 1 |
378 |
+#fi |
379 |
|
380 |
myscript="$1" |
381 |
-if [[ -L $1 && ! -L "/etc/init.d/${1##*/}" ]] ; then |
382 |
+if [[ -L $1 && ! -L "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${1##*/}" ]] ; then |
383 |
SVCNAME="$(readlink "$1")" |
384 |
else |
385 |
SVCNAME="$1" |
386 |
@@ -84,12 +84,12 @@ |
387 |
# configuration, if the system administrator chose to put it |
388 |
# there (if it exists). |
389 |
if net_service "${SVCNAME}" ; then |
390 |
- conf="$(add_suffix /etc/conf.d/net)" |
391 |
+ conf="$(add_suffix @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/net)" |
392 |
[[ -e ${conf} ]] && source "${conf}" |
393 |
fi |
394 |
-conf="$(add_suffix "/etc/conf.d/${SVCNAME}")" |
395 |
+conf="$(add_suffix "@GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${SVCNAME}")" |
396 |
[[ -e ${conf} ]] && source "${conf}" |
397 |
-conf="$(add_suffix /etc/rc.conf)" |
398 |
+conf="$(add_suffix @GENTOO_PORTAGE_EPREFIX@/etc/rc.conf)" |
399 |
[[ -e ${conf} ]] && source "${conf}" |
400 |
|
401 |
mylevel="${SOFTLEVEL}" |
402 |
@@ -146,7 +146,7 @@ |
403 |
local service="$1" start="$2" |
404 |
[[ ! -d "${svcdir}/scheduled/${service}" ]] \ |
405 |
&& mkdir -p "${svcdir}/scheduled/${service}" |
406 |
- ln -snf "/etc/init.d/${service}" \ |
407 |
+ ln -snf "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" \ |
408 |
"${svcdir}/scheduled/${service}/${start}" |
409 |
} |
410 |
|
411 |
@@ -334,9 +334,9 @@ |
412 |
if [[ ${retval} == "0" && ${RC_NO_DEPS} != "yes" ]] ; then |
413 |
local startupservices="$(ineed "${SVCNAME}") $(valid_iuse "${SVCNAME}")" |
414 |
local netservices= |
415 |
- for x in $(dolisting "/etc/runlevels/${BOOTLEVEL}/net.*") \ |
416 |
- $(dolisting "/etc/runlevels/${mylevel}/net.*") \ |
417 |
- $(dolisting "/var/lib/init.d/coldplugged/net.*") ; do |
418 |
+ for x in $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}/net.*") \ |
419 |
+ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${mylevel}/net.*") \ |
420 |
+ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/var/lib/init.d/coldplugged/net.*") ; do |
421 |
netservices="${netservices} ${x##*/}" |
422 |
done |
423 |
|
424 |
@@ -631,9 +631,9 @@ |
425 |
|
426 |
# Simple way to try and detect if the service use svc_{start,stop} |
427 |
# to restart if it have a custom restart() funtion. |
428 |
- if [[ -n $(egrep '^[[:space:]]*restart[[:space:]]*()' "/etc/init.d/${SVCNAME}") ]] ; then |
429 |
- if [[ -z $(egrep 'svc_stop' "/etc/init.d/${SVCNAME}") || \ |
430 |
- -z $(egrep 'svc_start' "/etc/init.d/${SVCNAME}") ]] ; then |
431 |
+ if [[ -n $(egrep '^[[:space:]]*restart[[:space:]]*()' "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${SVCNAME}") ]] ; then |
432 |
+ if [[ -z $(egrep 'svc_stop' "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${SVCNAME}") || \ |
433 |
+ -z $(egrep 'svc_start' "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${SVCNAME}") ]] ; then |
434 |
echo |
435 |
ewarn "Please use 'svc_stop; svc_start' and not 'stop; start' to" |
436 |
ewarn "restart the service in its custom 'restart()' function." |