Hi On Thu, 19 Apr 2007 22:32:50 +0200 Michael Biebl <[EMAIL PROTECTED]> wrote:
> could you please test and review the attached patch (against
> /etc/init.d/dbus) and tell me if it works for you.
>
> Add the following stanza to some of you init scripts
>
> ### BEGIN INIT INFO
> # Required-Start: dbus
> ### END INIT INFO
>
> and check if "/etc/init.d/dbus restart" stops and starts them in the
> correct order.
There is only small typo in patch, - should be at the end of chars
listing in regexp, otherwise it works. Updated diff attached.
--
Michal Čihař | http://cihar.com | http://blog.cihar.com
--- /tmp/dbus 2007-04-20 08:59:51.000000000 +0200
+++ init.d/dbus 2007-04-20 09:04:21.000000000 +0200
@@ -67,7 +67,15 @@
fi
# Get the list of services active in this runlevel
- services=$(grep -l "^# Required-Start:.*dbus" /etc/rc${r}.d/S??* | sort $param)
+ if [ -d /etc/rc${r}.d/ ] ; then # sysv-rc
+ services=$(grep -l "^# Required-Start:.*dbus" /etc/rc${r}.d/S??* | sort $param)
+ elif [ -f /etc/runlevel.conf ] ; then # file-rc
+ list=$(grep -l "^# Required-Start:.*dbus" /etc/init.d/*)
+ services=$( for i in $list ; do
+ grep -E "^[[:digit:]]{2}[[:space:]]+[0-9,S-]+[[:space:]]+.*${r}.*[[:space:]]+${i}$" /etc/runlevel.conf
+ done | sort $param | cut -f5 )
+ fi
+
# Start the services in the correct order
for i in $services ; do
signature.asc
Description: PGP signature

