Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] /etc/init.d/hwclock & /etc/init.d/ntp-client failed to start due to service dependency problem?
Date: Fri, 05 Sep 2008 08:08:05
Message-Id: 20080905090753.4c362aea@digimed.co.uk
In Reply to: [gentoo-user] /etc/init.d/hwclock & /etc/init.d/ntp-client failed to start due to service dependency problem? by "Wang
1 On Fri, 05 Sep 2008 10:24:25 +0800, Wang, Baojun wrote:
2
3 > depend section of /etc/init.d/hwclock, there is a line
4 >
5 > before *
6 >
7 > thus hwclock will start before modules (where I put rtc-cmos
8 > in /etc/conf.d/modules), so it will always fail to ajust hwclock.
9
10 Build it into the kernel. There's usually not much point in building
11 something as a module if you're going to load it every time you boot,
12 unless you want to pass it options.
13
14 > Besides, I'm using networkmanager (using gnome nm-applet) , so there
15 > is no /etc/init.d/net.eth* stuff, but ntp-client have a section of
16 >
17 > need net
18 >
19 > but at that time when ntp-client start, there is no network avaliable (I
20 > always get error will unable to reslove hostname XXX, so at least DNS is
21 > not usable at that time, even I put after NetworkManager
22 > in /etc/init.d/ntp-client).
23
24 Programs lime this and nfsmount should be started by NetworkManager's
25 Dispatcher so they start when a network interface comes up. This is how I
26 do it.
27
28 [nelz@krikkit ~ 0]% ls -l /etc/NetworkManager/dispatcher.d
29 total 4
30 lrwxrwxrwx 1 root root 10 2008-05-07 12:45 20-netmount -> default.sh
31 lrwxrwxrwx 1 root root 10 2008-05-07 12:45 30-nfsmount -> default.sh
32 lrwxrwxrwx 1 root root 10 2008-05-07 12:45 50-ntp-client -> default.sh
33 lrwxrwxrwx 1 root root 10 2008-05-07 12:45 70-ntpd -> default.sh
34 -rwxr-xr-x 1 root root 256 2008-05-07 12:51 default.sh
35
36 [nelz@krikkit ~ 0]% cat /etc/NetworkManager/dispatcher.d/default.sh
37 #!/bin/sh
38
39 service=$(basename $0 | cut -c4-)
40 [[ -e /etc/init.d/$service ]] || exit 0
41
42 if [[ "$2" == "up" ]] ; then
43 /etc/init.d/$service --quiet status || /etc/init.d/$service start
44 else
45 /etc/init.d/$service --quiet status && /etc/init.d/$service stop
46 fi
47
48
49 --
50 Neil Bothwick
51
52 Every time I jump on the bandwagon all its wheels fall off.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies