1 |
We can actually probably do this in bash fairly simply (although unless |
2 |
each service is started in sequence or in a seperate shellspace, it might |
3 |
be a problem) parallel start + bash variables = nastiness. |
4 |
|
5 |
for each initscript SVCNAME="apache2" |
6 |
then in the actual runscript, something like this would do just fine |
7 |
(imho) for 99% of what would need to be supported: |
8 |
|
9 |
SVCHOME=`whereis ${SVCNAME} | cut -d " " -f 2` |
10 |
if ${SVCNAME} != `ps aux | grep ${SVCHOME}`; then |
11 |
/etc/init.d/${SVCNAME} zap && |
12 |
/etc/init.d/${SVCNAME} start |
13 |
else |
14 |
SVC_STATUS="alive" |
15 |
fi |
16 |
|
17 |
Allen Parker |
18 |
(temporarily off my windows box :( i borked my raid firmware last night) |
19 |
|
20 |
On Mon, 3 May 2004, Paul de Vrieze wrote: |
21 |
|
22 |
> -----BEGIN PGP SIGNED MESSAGE----- |
23 |
> Hash: SHA1 |
24 |
> |
25 |
> On Monday 03 May 2004 08:15, Olivier Crête wrote: |
26 |
> > On Mon, 2004-05-03 at 07:10, John Nilsson wrote: |
27 |
> > > While on the topic: |
28 |
> > > Is it resonable to patch gdm so that /etc/init.d/xdm is zapped |
29 |
> > > after gdm is killed by selecting reboot/shutdown from the login |
30 |
> > > screen? It just annoys me that the script errors while shutting |
31 |
> > > down. |
32 |
> > |
33 |
> > This is imho a misfeature of the current initscripts system. The |
34 |
> > started-ness of an application is only checked against a file and not |
35 |
> > against the current real status. We should probably add a possible |
36 |
> > "status()" function to them (that would default to true) that would |
37 |
> > check if the service is still running in a custom way.. And zap it if |
38 |
> > it isnt... The problem there is with dependencies, should they be |
39 |
> > stopped if the service died? But the current system is clearly |
40 |
> > broken.. |
41 |
> |
42 |
> I agree, I think we should enhance the init scripts with another function |
43 |
> that can check the status of a daemon (in some way) and as such also |
44 |
> does not complain when a died daemon needs to be started. |
45 |
> |
46 |
> Paul |
47 |
> |
48 |
> - -- |
49 |
> Paul de Vrieze |
50 |
> Gentoo Developer |
51 |
> Mail: pauldv@g.o |
52 |
> Homepage: http://www.devrieze.net |
53 |
> -----BEGIN PGP SIGNATURE----- |
54 |
> Version: GnuPG v1.2.4 (GNU/Linux) |
55 |
> |
56 |
> iD8DBQFAlgMYbKx5DBjWFdsRAmOTAKDnA9E0PAVsCtMFAFJIkeKbLuJX/ACcDoCK |
57 |
> k3gzkzUnrA0n2unCEEpERH0= |
58 |
> =+tIc |
59 |
> -----END PGP SIGNATURE----- |
60 |
> |
61 |
> -- |
62 |
> gentoo-dev@g.o mailing list |
63 |
> |
64 |
> |
65 |
> |
66 |
|
67 |
-- |
68 |
gentoo-dev@g.o mailing list |