public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] init.d problem
@ 2006-07-04 21:25 Enrico Weigelt
  2006-07-04 21:36 ` Donnie Berkholz
  2006-07-04 22:03 ` Pablo Yanez Trujillo
  0 siblings, 2 replies; 14+ messages in thread
From: Enrico Weigelt @ 2006-07-04 21:25 UTC (permalink / raw
  To: gentoo developers


Hi folks,

maybe I've found a problem in the init.d stuff:

It seems that /var/lib/init.d/started/* is blindly trusted, 
instead of actually checking if some service is running.

For example, ntpd cannot be restarted via its init.d script
if it died for some reason - /var/lib/init.d/started/ntpd 
has to be removed manually.


I've filed a bug for it:

    http://bugs.gentoo.org/show_bug.cgi?id=139243


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 21:25 [gentoo-dev] init.d problem Enrico Weigelt
@ 2006-07-04 21:36 ` Donnie Berkholz
  2006-07-04 22:03 ` Pablo Yanez Trujillo
  1 sibling, 0 replies; 14+ messages in thread
From: Donnie Berkholz @ 2006-07-04 21:36 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

Enrico Weigelt wrote:
> Hi folks,
> 
> maybe I've found a problem in the init.d stuff:
> 
> It seems that /var/lib/init.d/started/* is blindly trusted, 
> instead of actually checking if some service is running.
> 
> For example, ntpd cannot be restarted via its init.d script
> if it died for some reason - /var/lib/init.d/started/ntpd 
> has to be removed manually.

Try  `/etc/init.d/foo zap`.

Thanks,
Donnie


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 21:25 [gentoo-dev] init.d problem Enrico Weigelt
  2006-07-04 21:36 ` Donnie Berkholz
@ 2006-07-04 22:03 ` Pablo Yanez Trujillo
  2006-07-04 22:43   ` Enrico Weigelt
  1 sibling, 1 reply; 14+ messages in thread
From: Pablo Yanez Trujillo @ 2006-07-04 22:03 UTC (permalink / raw
  To: gentoo-dev

what about "/etc/init.d/ntpd zap"? It deletes the file on /var/.... and set the status of the init.d-file as not 
started. It is useful for such a case :)

Regards
Pablo

Pablo Yánez Trujillo
http://klingsor.informatik.uni-freiburg.de/


Enrico Weigelt wrote:
> Hi folks,
> 
> maybe I've found a problem in the init.d stuff:
> 
> It seems that /var/lib/init.d/started/* is blindly trusted, 
> instead of actually checking if some service is running.
> 
> For example, ntpd cannot be restarted via its init.d script
> if it died for some reason - /var/lib/init.d/started/ntpd 
> has to be removed manually.
> 
> 
> I've filed a bug for it:
> 
>     http://bugs.gentoo.org/show_bug.cgi?id=139243
> 
> 
> cu
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 22:03 ` Pablo Yanez Trujillo
@ 2006-07-04 22:43   ` Enrico Weigelt
  2006-07-04 22:51     ` Nick Devito
                       ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Enrico Weigelt @ 2006-07-04 22:43 UTC (permalink / raw
  To: gentoo-dev

* Pablo Yanez Trujillo <yanezp@informatik.uni-freiburg.de> schrieb:
> what about "/etc/init.d/ntpd zap"? It deletes the file on /var/.... and set 
> the status of the init.d-file as not started. It is useful for such a case 
> :)

The problem is: if the service still runs, it will attemt to start it
twice. So this cannot be used in automatic processes, just for manual
intervention.

We should think about mechanisms to check if the service is 
actually running. This could also be used for frequently service
checks and notification.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 22:43   ` Enrico Weigelt
@ 2006-07-04 22:51     ` Nick Devito
  2006-07-04 22:58     ` Mike Frysinger
  2006-07-04 23:26     ` Pablo Yanez Trujillo
  2 siblings, 0 replies; 14+ messages in thread
From: Nick Devito @ 2006-07-04 22:51 UTC (permalink / raw
  To: gentoo-dev

One slightly hackish way would be the grab the PID, and check in ps aux
as to if it was running. That's one way to do what you are talking
about.

~ nick 
On Wed, 2006-07-05 at 00:43 +0200, Enrico Weigelt wrote:
> * Pablo Yanez Trujillo <yanezp@informatik.uni-freiburg.de> schrieb:
> > what about "/etc/init.d/ntpd zap"? It deletes the file on /var/.... and set 
> > the status of the init.d-file as not started. It is useful for such a case 
> > :)
> 
> The problem is: if the service still runs, it will attemt to start it
> twice. So this cannot be used in automatic processes, just for manual
> intervention.
> 
> We should think about mechanisms to check if the service is 
> actually running. This could also be used for frequently service
> checks and notification.
> 
> 
> cu
> -- 
> ---------------------------------------------------------------------
>  Enrico Weigelt    ==   metux IT service
> 
>   phone:     +49 36207 519931         www:       http://www.metux.de/
>   fax:       +49 36207 519932         email:     contact@metux.de
>   cellphone: +49 174 7066481
> ---------------------------------------------------------------------
>  -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
> ---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 22:43   ` Enrico Weigelt
  2006-07-04 22:51     ` Nick Devito
@ 2006-07-04 22:58     ` Mike Frysinger
  2006-07-04 23:12       ` Roy Marples
  2006-07-06 19:27       ` [gentoo-dev] " Albert Hopkins
  2006-07-04 23:26     ` Pablo Yanez Trujillo
  2 siblings, 2 replies; 14+ messages in thread
From: Mike Frysinger @ 2006-07-04 22:58 UTC (permalink / raw
  To: gentoo-dev; +Cc: Enrico Weigelt

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

On Tuesday 04 July 2006 18:43, Enrico Weigelt wrote:
> We should think about mechanisms to check if the service is
> actually running. This could also be used for frequently service
> checks and notification.

there is no fool proof way to do this
-mike

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 22:58     ` Mike Frysinger
@ 2006-07-04 23:12       ` Roy Marples
  2006-07-05 12:18         ` Enrico Weigelt
  2006-07-06 19:27       ` [gentoo-dev] " Albert Hopkins
  1 sibling, 1 reply; 14+ messages in thread
From: Roy Marples @ 2006-07-04 23:12 UTC (permalink / raw
  To: gentoo-dev

On Tuesday 04 July 2006 23:58, Mike Frysinger wrote:
> On Tuesday 04 July 2006 18:43, Enrico Weigelt wrote:
> > We should think about mechanisms to check if the service is
> > actually running. This could also be used for frequently service
> > checks and notification.
>
> there is no fool proof way to do this
> -mike

No there's not as what the init script actually starts is up to the init 
script.

However, with baselayout-1.12 we intercept calls to start-stop-daemon and 
store information about what was started (binary, pidfile) so when root then 
does "/etc/init.d/foo status" we check to see if all the binaries are still 
running. If not then we do an "/etc/init.d/foo stop" behind the scenes.

But some init scripts don't use start-stop-daemon, like sshd. These scripts 
will need to be re-working around start-stop-daemon.

-- 
Roy Marples <uberlord@gentoo.org>
Gentoo/Linux Developer (baselayout, networking)
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 22:43   ` Enrico Weigelt
  2006-07-04 22:51     ` Nick Devito
  2006-07-04 22:58     ` Mike Frysinger
@ 2006-07-04 23:26     ` Pablo Yanez Trujillo
  2 siblings, 0 replies; 14+ messages in thread
From: Pablo Yanez Trujillo @ 2006-07-04 23:26 UTC (permalink / raw
  To: gentoo-dev

 > The problem is: if the service still runs,

yes, I know. But I read the bug report and Enrico wrote that for some reasons the service didn't run anymore.
"if it had been started but terminated abnormally (not through this script)" and in this case the zap argument is for me 
the right solution :)

 > We should think about mechanisms to check if the service is
 > actually running.

Yes, that's right, I have sometimes problem with apache2 and need to kill apache2 and use the zap argument.

cu

Pablo Yánez Trujillo
http://klingsor.informatik.uni-freiburg.de/


Enrico Weigelt wrote:
> * Pablo Yanez Trujillo <yanezp@informatik.uni-freiburg.de> schrieb:
>> what about "/etc/init.d/ntpd zap"? It deletes the file on /var/.... and set 
>> the status of the init.d-file as not started. It is useful for such a case 
>> :)
> 
> The problem is: if the service still runs, it will attemt to start it
> twice. So this cannot be used in automatic processes, just for manual
> intervention.
> 
> We should think about mechanisms to check if the service is 
> actually running. This could also be used for frequently service
> checks and notification.
> 
> 
> cu
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 23:12       ` Roy Marples
@ 2006-07-05 12:18         ` Enrico Weigelt
  2006-07-05 17:40           ` [gentoo-dev] " Duncan
  0 siblings, 1 reply; 14+ messages in thread
From: Enrico Weigelt @ 2006-07-05 12:18 UTC (permalink / raw
  To: gentoo-dev

* Roy Marples <uberlord@gentoo.org> schrieb:

<snip>

> However, with baselayout-1.12 we intercept calls to start-stop-daemon 
> and store information about what was started (binary, pidfile) so 
> when root then does "/etc/init.d/foo status" we check to see if all 
> the binaries are still running. If not then we do an "/etc/init.d/foo stop" 
> behind the scenes.

Sounds good to me. So an regular "<init-scipt> status" (ie. via cron) 
will fix the stuff. Maybe status && start would be suited for bringing
up died services automatically, if it always gives proper exit codes.

When will it the new baselayout be ready ?

> But some init scripts don't use start-stop-daemon, like sshd. 
> These scripts will need to be re-working around start-stop-daemon.

Okay. I could add a low-priority bug to all packages running at my
site not yet using start-stop-daemon and maybe submit an patch.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-dev]  Re: init.d problem
  2006-07-05 12:18         ` Enrico Weigelt
@ 2006-07-05 17:40           ` Duncan
  2006-07-05 18:40             ` Philip Webb
  0 siblings, 1 reply; 14+ messages in thread
From: Duncan @ 2006-07-05 17:40 UTC (permalink / raw
  To: gentoo-dev

Enrico Weigelt <weigelt@metux.de> posted
20060705121845.GA23393@nibiru.local, excerpted below, on  Wed, 05 Jul 2006
14:18:45 +0200:

> * Roy Marples <uberlord@gentoo.org> schrieb:
> 
>> However, with baselayout-1.12 we intercept calls to start-stop-daemon
>> and store information about what was started (binary, pidfile)
> 
> Sounds good to me. So an regular "<init-scipt> status" (ie. via cron) will
> fix the stuff. Maybe status && start would be suited for bringing up died
> services automatically, if it always gives proper exit codes.
> 
> When will it the new baselayout be ready ?

$emerge -p baselayout
[snip]
[ebuild   R   ] sys-apps/baselayout-1.12.1

$emerge --info|grep KEYWORDS
ACCEPT_KEYWORDS="amd64 ~amd64"

IOW, 1.12.1 is already in ~arch, so 1.12 has been there for some time. 
I've been enjoying this new product of uberlord's hard work for awhile,
here. =8^)

1.12 is on track to be stablized for 2006.1, AFAIK, so it should be fairly
soon now.



-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev]  Re: init.d problem
  2006-07-05 17:40           ` [gentoo-dev] " Duncan
@ 2006-07-05 18:40             ` Philip Webb
  0 siblings, 0 replies; 14+ messages in thread
From: Philip Webb @ 2006-07-05 18:40 UTC (permalink / raw
  To: gentoo-dev

Enrico Weigelt <weigelt@metux.de> posted 060705
> When will it the new baselayout (1.12.0) be ready ?

I've been using it since 060604 without any problems.

-- 
========================,,============================================
SUPPORT     ___________//___,  Philip Webb : purslow@chass.utoronto.ca
ELECTRIC   /] [] [] [] [] []|  Centre for Urban & Community Studies
TRANSIT    `-O----------O---'  University of Toronto
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-04 22:58     ` Mike Frysinger
  2006-07-04 23:12       ` Roy Marples
@ 2006-07-06 19:27       ` Albert Hopkins
  2006-07-06 22:18         ` Mike Frysinger
  1 sibling, 1 reply; 14+ messages in thread
From: Albert Hopkins @ 2006-07-06 19:27 UTC (permalink / raw
  To: gentoo-dev; +Cc: Enrico Weigelt

On Tue, 2006-07-04 at 18:58 -0400, Mike Frysinger wrote:
> On Tuesday 04 July 2006 18:43, Enrico Weigelt wrote:
> > We should think about mechanisms to check if the service is
> > actually running. This could also be used for frequently service
> > checks and notification.
> 
> there is no fool proof way to do this

Has anyone considered daemontools?  It does this kind of stuff very
well.

-m

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-06 19:27       ` [gentoo-dev] " Albert Hopkins
@ 2006-07-06 22:18         ` Mike Frysinger
  2006-07-07 10:48           ` Martin Schlemmer
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2006-07-06 22:18 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

On Thursday 06 July 2006 15:27, Albert Hopkins wrote:
> On Tue, 2006-07-04 at 18:58 -0400, Mike Frysinger wrote:
> > On Tuesday 04 July 2006 18:43, Enrico Weigelt wrote:
> > > We should think about mechanisms to check if the service is
> > > actually running. This could also be used for frequently service
> > > checks and notification.
> >
> > there is no fool proof way to do this
>
> Has anyone considered daemontools?  It does this kind of stuff very
> well.

you're "fixing" the issue by replacing sysvinit/baselayout with daemontools

some people may want to do that but really i dont see how that's generally 
relevant to this discussion
-mike

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [gentoo-dev] init.d problem
  2006-07-06 22:18         ` Mike Frysinger
@ 2006-07-07 10:48           ` Martin Schlemmer
  0 siblings, 0 replies; 14+ messages in thread
From: Martin Schlemmer @ 2006-07-07 10:48 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

On Thu, 2006-07-06 at 18:18 -0400, Mike Frysinger wrote:
> On Thursday 06 July 2006 15:27, Albert Hopkins wrote:
> > On Tue, 2006-07-04 at 18:58 -0400, Mike Frysinger wrote:
> > > On Tuesday 04 July 2006 18:43, Enrico Weigelt wrote:
> > > > We should think about mechanisms to check if the service is
> > > > actually running. This could also be used for frequently service
> > > > checks and notification.
> > >
> > > there is no fool proof way to do this
> >
> > Has anyone considered daemontools?  It does this kind of stuff very
> > well.
> 
> you're "fixing" the issue by replacing sysvinit/baselayout with daemontools
> 
> some people may want to do that but really i dont see how that's generally 
> relevant to this discussion

There are wrapper scripts if you want to use daemontools with
rc-scripts:

  sys-process/daemontools-scripts


-- 
Martin Schlemmer


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-07-07 10:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-04 21:25 [gentoo-dev] init.d problem Enrico Weigelt
2006-07-04 21:36 ` Donnie Berkholz
2006-07-04 22:03 ` Pablo Yanez Trujillo
2006-07-04 22:43   ` Enrico Weigelt
2006-07-04 22:51     ` Nick Devito
2006-07-04 22:58     ` Mike Frysinger
2006-07-04 23:12       ` Roy Marples
2006-07-05 12:18         ` Enrico Weigelt
2006-07-05 17:40           ` [gentoo-dev] " Duncan
2006-07-05 18:40             ` Philip Webb
2006-07-06 19:27       ` [gentoo-dev] " Albert Hopkins
2006-07-06 22:18         ` Mike Frysinger
2006-07-07 10:48           ` Martin Schlemmer
2006-07-04 23:26     ` Pablo Yanez Trujillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox