1 |
commit: 7c30187d5795b90e9af37a88c8b5d787cdfa0389 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 11 04:20:51 2011 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 11 04:20:51 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/livecd-tools.git;a=commit;h=7c30187d |
7 |
|
8 |
use "rc-service -i" to test for and start services |
9 |
|
10 |
With openrc, we can use "rc-service -i foo start" to test for the existance of |
11 |
service foo and start it if it does exist. |
12 |
|
13 |
--- |
14 |
autoconfig | 23 ++++++++++------------- |
15 |
1 files changed, 10 insertions(+), 13 deletions(-) |
16 |
|
17 |
diff --git a/autoconfig b/autoconfig |
18 |
index cdcb89c..d8df734 100755 |
19 |
--- a/autoconfig |
20 |
+++ b/autoconfig |
21 |
@@ -474,7 +474,7 @@ start() { |
22 |
then |
23 |
modprobe apm power_off=1 >/dev/null 2>&1 && \ |
24 |
einfo "APM BIOS found, power management functions enabled ..." |
25 |
- [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start |
26 |
+ rc-service -i apmd start |
27 |
else |
28 |
einfo "Not Loading APM Bios support ..." |
29 |
fi |
30 |
@@ -491,7 +491,7 @@ start() { |
31 |
modprobe thermal >/dev/null 2>&1 |
32 |
modprobe video >/dev/null 2>&1 |
33 |
modprobe dock >/dev/null 2>&1 |
34 |
- [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start |
35 |
+ rc-service -i acpid start |
36 |
eend |
37 |
else |
38 |
einfo "Not Loading ACPI support ..." |
39 |
@@ -499,14 +499,14 @@ start() { |
40 |
|
41 |
if yesno "${IDEDMA}" |
42 |
then |
43 |
- [ -x /etc/init.d/hdparm ] && /etc/init.d/hdparm start |
44 |
+ rc-service -i hdparm start |
45 |
else |
46 |
ewarn "Disabling IDE DMA support ..." |
47 |
fi |
48 |
|
49 |
if yesno "${PCMCIA}" |
50 |
then |
51 |
- [ -x /etc/init.d/pcmcia ] && /etc/init.d/pcmcia start |
52 |
+ rc-service -i pcmcia start |
53 |
else |
54 |
ewarn "PCMCIA disabled via cmdline ..." |
55 |
fi |
56 |
@@ -559,14 +559,14 @@ start() { |
57 |
done |
58 |
if yesno "${NFS}" |
59 |
then |
60 |
- [ -x /etc/init.d/portmap ] && /etc/init.d/portmap start |
61 |
- [ -x /etc/init.d/nfsmount ] && /etc/init.d/nfsmount start |
62 |
+ rc-service -i portmap start |
63 |
+ rc-service -i nfsmount start |
64 |
fi |
65 |
if ! yesno "${PASSWD}" |
66 |
then |
67 |
echo "root:${PASSWORD}" | chpasswd > /dev/null 2>&1 |
68 |
else |
69 |
- /etc/init.d/pwgen start |
70 |
+ rc-service pwgen start |
71 |
fi |
72 |
if yesno "${SSHD}" |
73 |
then |
74 |
@@ -577,7 +577,7 @@ start() { |
75 |
ewarn "WARNING: You are starting sshd with a scrambled root password!!!" |
76 |
ewarn "WARNING: You need to set a root password to be able to login remotely." |
77 |
fi |
78 |
- [ -x /etc/init.d/sshd ] && /etc/init.d/sshd start |
79 |
+ rc-service -i sshd start |
80 |
fi |
81 |
else |
82 |
ewarn "No Network device auto detected ..." |
83 |
@@ -596,10 +596,7 @@ start() { |
84 |
|
85 |
einfo "${sndmsg}" |
86 |
|
87 |
- if [ -x /etc/init.d/alsasound ] |
88 |
- then |
89 |
- /etc/init.d/alsasound start |
90 |
- fi |
91 |
+ rc-service -i alsasound start |
92 |
|
93 |
if [ -e /proc/asound/cards ] |
94 |
then |
95 |
@@ -640,7 +637,7 @@ start() { |
96 |
|
97 |
if [ "${SPEAKUP_MODULE}" = "speakup_soft" ] |
98 |
then |
99 |
- [ -x /etc/init.d/espeakup ] && /etc/init.d/espeakup start |
100 |
+ rc-service -i espeakup start |
101 |
fi |
102 |
fi |
103 |
fi |