* [gentoo-dev] strange gentoo shutdown sequence
@ 2004-05-02 11:40 Sven Köhler
0 siblings, 0 replies; 11+ messages in thread
From: Sven Köhler @ 2004-05-02 11:40 UTC (permalink / raw
To: gentoo-dev
hi,
gentoo usually does the following if i execute halt or reboot:
sending all processes the TERM signal
sending all processes the KILL signal
stopping xdm ...
stopping alsasound ...
etc....
in may eyes, this has to be the other way round:
first shutdown all deamons properly with the init.d-script, and than
send the remaining processes the TERM and KILL signals.
why does gentoo handle things the way it does? redhat etc. do it the
other way i described. using the init.d-script sounds more resonable to me.
Thx
Sven
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
@ 2004-05-02 17:32 William Hubbs
2004-05-03 5:10 ` John Nilsson
2004-05-03 16:24 ` splite-gentoo
0 siblings, 2 replies; 11+ messages in thread
From: William Hubbs @ 2004-05-02 17:32 UTC (permalink / raw
To: gentoo development
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
On Sun, May 02, 2004 at 01:40:08PM +0200, Sven K?hler wrote:
> hi,
>
> gentoo usually does the following if i execute halt or reboot:
>
> sending all processes the TERM signal
> sending all processes the KILL signal
> stopping xdm ...
> stopping alsasound ...
> etc....
>
> in may eyes, this has to be the other way round:
> first shutdown all deamons properly with the init.d-script, and than
> send the remaining processes the TERM and KILL signals.
>
>
> why does gentoo handle things the way it does? redhat etc. do it the
> other way i described. using the init.d-script sounds more resonable to me.
I just confirmed this. When you do a shutdown or a reboot or halt, the processes are killed by the kill and term signals before the services are actually stopped with the /etc/init.d/* scripts.
Is there a reason for this or should it be the other way around?
William
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAlTCnblQW9DDEZTgRAhpFAKCHZKYcQ7pf3cW8k8cFSIwCSYOOxACfWb3z
FwWqFEXh6xyd6I8prHhvi6E=
=31D5
-----END PGP SIGNATURE-----
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-02 17:32 William Hubbs
@ 2004-05-03 5:10 ` John Nilsson
2004-05-03 6:15 ` Olivier Crête
2004-05-03 16:24 ` splite-gentoo
1 sibling, 1 reply; 11+ messages in thread
From: John Nilsson @ 2004-05-03 5:10 UTC (permalink / raw
To: William Hubbs; +Cc: gentoo development
[-- Attachment #1: Type: text/plain, Size: 231 bytes --]
While on the topic:
Is it resonable to patch gdm so that /etc/init.d/xdm is zapped after
gdm is killed by selecting reboot/shutdown from the login screen?
It just annoys me that the script errors while shutting down.
-John
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-03 5:10 ` John Nilsson
@ 2004-05-03 6:15 ` Olivier Crête
2004-05-03 6:46 ` John Nilsson
2004-05-03 8:30 ` Paul de Vrieze
0 siblings, 2 replies; 11+ messages in thread
From: Olivier Crête @ 2004-05-03 6:15 UTC (permalink / raw
To: John Nilsson; +Cc: gentoo development
[-- Attachment #1: Type: text/plain, Size: 828 bytes --]
On Mon, 2004-05-03 at 07:10, John Nilsson wrote:
> While on the topic:
> Is it resonable to patch gdm so that /etc/init.d/xdm is zapped after
> gdm is killed by selecting reboot/shutdown from the login screen?
> It just annoys me that the script errors while shutting down.
This is imho a misfeature of the current initscripts system. The
started-ness of an application is only checked against a file and not
against the current real status. We should probably add a possible
"status()" function to them (that would default to true) that would
check if the service is still running in a custom way.. And zap it if it
isnt... The problem there is with dependencies, should they be stopped
if the service died? But the current system is clearly broken..
--
Olivier Crête
tester@gentoo.org
Gentoo Developer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-03 6:15 ` Olivier Crête
@ 2004-05-03 6:46 ` John Nilsson
2004-05-03 17:22 ` Grant Goodyear
2004-05-03 8:30 ` Paul de Vrieze
1 sibling, 1 reply; 11+ messages in thread
From: John Nilsson @ 2004-05-03 6:46 UTC (permalink / raw
To: Olivier Crête; +Cc: gentoo development
[-- Attachment #1: Type: text/plain, Size: 966 bytes --]
I remember a time when gentoo (enoch?) used djb's daemontools to manages
services. Why was this changed?
-John
On Mon, 2004-05-03 at 08:15, Olivier Crête wrote:
> On Mon, 2004-05-03 at 07:10, John Nilsson wrote:
> > While on the topic:
> > Is it resonable to patch gdm so that /etc/init.d/xdm is zapped after
> > gdm is killed by selecting reboot/shutdown from the login screen?
> > It just annoys me that the script errors while shutting down.
>
>
> This is imho a misfeature of the current initscripts system. The
> started-ness of an application is only checked against a file and not
> against the current real status. We should probably add a possible
> "status()" function to them (that would default to true) that would
> check if the service is still running in a custom way.. And zap it if it
> isnt... The problem there is with dependencies, should they be stopped
> if the service died? But the current system is clearly broken..
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-03 6:15 ` Olivier Crête
2004-05-03 6:46 ` John Nilsson
@ 2004-05-03 8:30 ` Paul de Vrieze
2004-05-03 8:50 ` Allen D Parker
1 sibling, 1 reply; 11+ messages in thread
From: Paul de Vrieze @ 2004-05-03 8:30 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 03 May 2004 08:15, Olivier Crête wrote:
> On Mon, 2004-05-03 at 07:10, John Nilsson wrote:
> > While on the topic:
> > Is it resonable to patch gdm so that /etc/init.d/xdm is zapped
> > after gdm is killed by selecting reboot/shutdown from the login
> > screen? It just annoys me that the script errors while shutting
> > down.
>
> This is imho a misfeature of the current initscripts system. The
> started-ness of an application is only checked against a file and not
> against the current real status. We should probably add a possible
> "status()" function to them (that would default to true) that would
> check if the service is still running in a custom way.. And zap it if
> it isnt... The problem there is with dependencies, should they be
> stopped if the service died? But the current system is clearly
> broken..
I agree, I think we should enhance the init scripts with another function
that can check the status of a daemon (in some way) and as such also
does not complain when a died daemon needs to be started.
Paul
- --
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAlgMYbKx5DBjWFdsRAmOTAKDnA9E0PAVsCtMFAFJIkeKbLuJX/ACcDoCK
k3gzkzUnrA0n2unCEEpERH0=
=+tIc
-----END PGP SIGNATURE-----
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-03 8:30 ` Paul de Vrieze
@ 2004-05-03 8:50 ` Allen D Parker
2004-05-03 9:05 ` Paul de Vrieze
0 siblings, 1 reply; 11+ messages in thread
From: Allen D Parker @ 2004-05-03 8:50 UTC (permalink / raw
To: Paul de Vrieze; +Cc: gentoo-dev
We can actually probably do this in bash fairly simply (although unless
each service is started in sequence or in a seperate shellspace, it might
be a problem) parallel start + bash variables = nastiness.
for each initscript SVCNAME="apache2"
then in the actual runscript, something like this would do just fine
(imho) for 99% of what would need to be supported:
SVCHOME=`whereis ${SVCNAME} | cut -d " " -f 2`
if ${SVCNAME} != `ps aux | grep ${SVCHOME}`; then
/etc/init.d/${SVCNAME} zap &&
/etc/init.d/${SVCNAME} start
else
SVC_STATUS="alive"
fi
Allen Parker
(temporarily off my windows box :( i borked my raid firmware last night)
On Mon, 3 May 2004, Paul de Vrieze wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Monday 03 May 2004 08:15, Olivier Crête wrote:
> > On Mon, 2004-05-03 at 07:10, John Nilsson wrote:
> > > While on the topic:
> > > Is it resonable to patch gdm so that /etc/init.d/xdm is zapped
> > > after gdm is killed by selecting reboot/shutdown from the login
> > > screen? It just annoys me that the script errors while shutting
> > > down.
> >
> > This is imho a misfeature of the current initscripts system. The
> > started-ness of an application is only checked against a file and not
> > against the current real status. We should probably add a possible
> > "status()" function to them (that would default to true) that would
> > check if the service is still running in a custom way.. And zap it if
> > it isnt... The problem there is with dependencies, should they be
> > stopped if the service died? But the current system is clearly
> > broken..
>
> I agree, I think we should enhance the init scripts with another function
> that can check the status of a daemon (in some way) and as such also
> does not complain when a died daemon needs to be started.
>
> Paul
>
> - --
> Paul de Vrieze
> Gentoo Developer
> Mail: pauldv@gentoo.org
> Homepage: http://www.devrieze.net
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFAlgMYbKx5DBjWFdsRAmOTAKDnA9E0PAVsCtMFAFJIkeKbLuJX/ACcDoCK
> k3gzkzUnrA0n2unCEEpERH0=
> =+tIc
> -----END PGP SIGNATURE-----
>
> --
> gentoo-dev@gentoo.org mailing list
>
>
>
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-03 8:50 ` Allen D Parker
@ 2004-05-03 9:05 ` Paul de Vrieze
2004-05-05 18:11 ` Martin Schlemmer
0 siblings, 1 reply; 11+ messages in thread
From: Paul de Vrieze @ 2004-05-03 9:05 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 03 May 2004 10:50, Allen D Parker wrote:
> We can actually probably do this in bash fairly simply (although
> unless each service is started in sequence or in a seperate
> shellspace, it might be a problem) parallel start + bash variables =
> nastiness.
>
> for each initscript SVCNAME="apache2"
> then in the actual runscript, something like this would do just fine
> (imho) for 99% of what would need to be supported:
>
> SVCHOME=`whereis ${SVCNAME} | cut -d " " -f 2`
> if ${SVCNAME} != `ps aux | grep ${SVCHOME}`; then
> /etc/init.d/${SVCNAME} zap &&
> /etc/init.d/${SVCNAME} start
> else
> SVC_STATUS="alive"
> fi
I was more thinking of providing an extra function (say "status()") that
would have a positive result if the service is actually running and a
negative result if it is not. The handler script/program should then be
able to handle this function.
Paul
- --
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAlgtrbKx5DBjWFdsRAhbPAKC1Odou8xvkbFDq88+XZWsHn61ZmQCeLZFu
mWaX+8vIxnS8J8QNcXd6s84=
=6SqF
-----END PGP SIGNATURE-----
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-03 9:05 ` Paul de Vrieze
@ 2004-05-05 18:11 ` Martin Schlemmer
0 siblings, 0 replies; 11+ messages in thread
From: Martin Schlemmer @ 2004-05-05 18:11 UTC (permalink / raw
To: Paul de Vrieze; +Cc: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]
On Mon, 2004-05-03 at 11:05, Paul de Vrieze wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Monday 03 May 2004 10:50, Allen D Parker wrote:
> > We can actually probably do this in bash fairly simply (although
> > unless each service is started in sequence or in a seperate
> > shellspace, it might be a problem) parallel start + bash variables =
> > nastiness.
> >
> > for each initscript SVCNAME="apache2"
> > then in the actual runscript, something like this would do just fine
> > (imho) for 99% of what would need to be supported:
> >
> > SVCHOME=`whereis ${SVCNAME} | cut -d " " -f 2`
> > if ${SVCNAME} != `ps aux | grep ${SVCHOME}`; then
> > /etc/init.d/${SVCNAME} zap &&
> > /etc/init.d/${SVCNAME} start
> > else
> > SVC_STATUS="alive"
> > fi
>
> I was more thinking of providing an extra function (say "status()") that
> would have a positive result if the service is actually running and a
> negative result if it is not. The handler script/program should then be
> able to handle this function.
>
There is one that can be overridden. Also have a look at
/lib/rcscripts/sh/rc-daemon.sh - yeah, its crude, its very alpha (did
it in a night some months back), but it was supposed to be generic
daemon handling, with checking of pid, etc.
--
Martin Schlemmer
Gentoo Linux Developer, Desktop/System Team Developer
Cape Town, South Africa
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] strange gentoo shutdown sequence
2004-05-02 17:32 William Hubbs
2004-05-03 5:10 ` John Nilsson
@ 2004-05-03 16:24 ` splite-gentoo
1 sibling, 0 replies; 11+ messages in thread
From: splite-gentoo @ 2004-05-03 16:24 UTC (permalink / raw
To: gentoo development
On Sun, May 02, 2004 at 12:32:23PM -0500, William Hubbs wrote:
> Hi all,
>
> On Sun, May 02, 2004 at 01:40:08PM +0200, Sven K?hler wrote:
> > hi,
> >
> > gentoo usually does the following if i execute halt or reboot:
> >
> > sending all processes the TERM signal
> > sending all processes the KILL signal
> > stopping xdm ...
> > stopping alsasound ...
> > etc....
> >
> > in may eyes, this has to be the other way round:
> > first shutdown all deamons properly with the init.d-script, and than
> > send the remaining processes the TERM and KILL signals.
> >
> >
> > why does gentoo handle things the way it does? redhat etc. do it the
> > other way i described. using the init.d-script sounds more resonable to me.
>
> I just confirmed this. When you do a shutdown or a reboot or halt, the processes are killed by the kill and term signals before the services are actually stopped with the /etc/init.d/* scripts.
>
> Is there a reason for this or should it be the other way around?
init(8) itself sends the TERM and KILL signals when changing runlevels, and
there's no way around that, save patching init.
It's not a real problem because init only signals processes still in init's
process group, and there usually aren't any. (Run "ps -eo pid,pgrp,cmd" to
see if any are, if you're curious.)
"man init" for more info.
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-05-05 18:07 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-02 11:40 [gentoo-dev] strange gentoo shutdown sequence Sven Köhler
-- strict thread matches above, loose matches on Subject: below --
2004-05-02 17:32 William Hubbs
2004-05-03 5:10 ` John Nilsson
2004-05-03 6:15 ` Olivier Crête
2004-05-03 6:46 ` John Nilsson
2004-05-03 17:22 ` Grant Goodyear
2004-05-03 8:30 ` Paul de Vrieze
2004-05-03 8:50 ` Allen D Parker
2004-05-03 9:05 ` Paul de Vrieze
2004-05-05 18:11 ` Martin Schlemmer
2004-05-03 16:24 ` splite-gentoo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox