public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] /var/lib/init.d/* vs. pidfiles
@ 2006-12-18 17:39 Enrico Weigelt
  2006-12-18 18:05 ` Roy Marples
  0 siblings, 1 reply; 9+ messages in thread
From: Enrico Weigelt @ 2006-12-18 17:39 UTC (permalink / raw
  To: gentoo developers


Hi folks,


the bug 139243 shows an possible problem in the init.d system:
it stores the service status in /var/lib/init.d/started and
of course refuses to start an certain service if its already
there (at least if "zap" not given).

This is okay, as long as services don't die abnormally, as my
ntpd did in bug 139243 - in this case init.d thinks it's already
running and so of course refuses to start it.

The main problem is that init.d relies on its own status flag,
but does not check any pidfile and so has wrong information.

Is there already any way for telling it to use some pidfile ?
The files in /var/lib/init.d/deamons already contain pidfiles,
so this could be used.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-18 17:39 [gentoo-dev] /var/lib/init.d/* vs. pidfiles Enrico Weigelt
@ 2006-12-18 18:05 ` Roy Marples
  2006-12-23 19:50   ` Enrico Weigelt
  0 siblings, 1 reply; 9+ messages in thread
From: Roy Marples @ 2006-12-18 18:05 UTC (permalink / raw
  To: gentoo-dev

On Mon, 18 Dec 2006 18:39:06 +0100
Enrico Weigelt <weigelt@metux.de> wrote:
> 
> Hi folks,
> 
> 
> the bug 139243 shows an possible problem in the init.d system
> it stores the service status in /var/lib/init.d/started and

I'm going to stop you right there.
Before claiming design problems in the init system, you could at least
have the good grace to try out the most current available in portage
where you would know

1) status is now in /lib/rcscripts/init.d/{started,starting,etc}
2) A simple status call to the init script checks running daemons and
returns either 0 or 1 appropriately allowing a sys admin to report on
crashed services and possible take an automated action.

This isn't the first time you've done this, but please when you feel
the urge to post the next time try searching the archives and or
bugzilla where this exact issue has already been discussed.

Thanks

Roy
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-18 18:05 ` Roy Marples
@ 2006-12-23 19:50   ` Enrico Weigelt
  2006-12-23 20:14     ` Mike Frysinger
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Enrico Weigelt @ 2006-12-23 19:50 UTC (permalink / raw
  To: gentoo-dev

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

<snip>

> I'm going to stop you right there.
> Before claiming design problems in the init system, you could at least
> have the good grace to try out the most current available in portage
> where you would know

Well, I just sync'ed and `emerge -puD system` doesn't show up anything 
todo, and I didn't mask out anything. So can I assume my init system 
is up to date ?

> 1) status is now in /lib/rcscripts/init.d/{started,starting,etc}

Not at my site, just checked it.

> 2) A simple status call to the init script checks running daemons and
> returns either 0 or 1 appropriately allowing a sys admin to report on
> crashed services and possible take an automated action.

Yes, of course. But that's not what I'm actually looking for.
Recently I had the problem that some service died, which was necessary
for another one. While trying to start the other one, I ran into 
trouble since the init system didn't know about the died service.

If the lookup would go directly to checking things like pidfiles
(where applicable) instead of the flag files, such problems would
(IMHO) be entirely fixed.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-23 19:50   ` Enrico Weigelt
@ 2006-12-23 20:14     ` Mike Frysinger
  2006-12-23 20:50       ` Enrico Weigelt
  2006-12-23 20:22     ` Roy Marples
  2006-12-23 21:05     ` Roy Marples
  2 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2006-12-23 20:14 UTC (permalink / raw
  To: gentoo-dev

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

On Saturday 23 December 2006 14:50, Enrico Weigelt wrote:
> Well, I just sync'ed and `emerge -puD system` doesn't show up anything
> todo, and I didn't mask out anything. So can I assume my init system
> is up to date ?

i'm pretty sure he's talking about the 1.13 series which he's put a lot of 
time into

> If the lookup would go directly to checking things like pidfiles
> (where applicable) instead of the flag files, such problems would
> (IMHO) be entirely fixed.

well that's why it's just your opinion and not actual fact ... pidfiles are 
not completely reliable
-mike

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

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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-23 19:50   ` Enrico Weigelt
  2006-12-23 20:14     ` Mike Frysinger
@ 2006-12-23 20:22     ` Roy Marples
  2006-12-23 21:08       ` Enrico Weigelt
  2006-12-23 21:05     ` Roy Marples
  2 siblings, 1 reply; 9+ messages in thread
From: Roy Marples @ 2006-12-23 20:22 UTC (permalink / raw
  To: gentoo-dev

On Sat, 23 Dec 2006 20:50:06 +0100
Enrico Weigelt <weigelt@metux.de> wrote:

> * Roy Marples <uberlord@gentoo.org> schrieb:
> 
> <snip>
> 
> > I'm going to stop you right there.
> > Before claiming design problems in the init system, you could at
> > least have the good grace to try out the most current available in
> > portage where you would know
> 
> Well, I just sync'ed and `emerge -puD system` doesn't show up
> anything todo, and I didn't mask out anything. So can I assume my
> init system is up to date ?

No you cannot.
baselayout-1.13 is currently package.masked as there are still a few
upgrade/downgrade issues to resolve with the 1.12 branch. However, it
is unmasked on BSD profiles where it's enjoying great success.
Hopefully in the new year it can be moved to ~ARCH.

Thanks

Roy
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-23 20:14     ` Mike Frysinger
@ 2006-12-23 20:50       ` Enrico Weigelt
  0 siblings, 0 replies; 9+ messages in thread
From: Enrico Weigelt @ 2006-12-23 20:50 UTC (permalink / raw
  To: gentoo-dev

* Mike Frysinger <vapier@gentoo.org> schrieb:

> > If the lookup would go directly to checking things like pidfiles
> > (where applicable) instead of the flag files, such problems would
> > (IMHO) be entirely fixed.
> 
> well that's why it's just your opinion and not actual fact ... 
> pidfiles are not completely reliable

maybe, but in which situations would it be worse than the 
current situation ?


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-23 19:50   ` Enrico Weigelt
  2006-12-23 20:14     ` Mike Frysinger
  2006-12-23 20:22     ` Roy Marples
@ 2006-12-23 21:05     ` Roy Marples
  2 siblings, 0 replies; 9+ messages in thread
From: Roy Marples @ 2006-12-23 21:05 UTC (permalink / raw
  To: gentoo-dev

On Sat, 23 Dec 2006 20:50:06 +0100
Enrico Weigelt <weigelt@metux.de> wrote:

> > 2) A simple status call to the init script checks running daemons
> > and returns either 0 or 1 appropriately allowing a sys admin to
> > report on crashed services and possible take an automated action.
> 
> Yes, of course. But that's not what I'm actually looking for.
> Recently I had the problem that some service died, which was necessary
> for another one. While trying to start the other one, I ran into 
> trouble since the init system didn't know about the died service.
> 
> If the lookup would go directly to checking things like pidfiles
> (where applicable) instead of the flag files, such problems would
> (IMHO) be entirely fixed.

OK, read the code yourself as you don't belive me.
http://sources.gentoo.org/viewcvs.py/baselayout/trunk/sh/rc-daemon.sh?rev=2441&view=markup
But as it's Christmas I'll tell you anyway.

A status check will examine every daemon started by start-stop-daemon
in the service and check if it's still running by the process name/exec
file and optional that it's running on the given pid in a pidfile if
specified. If any listed daemons have crashed then the service is
stopped and the stopped status is returned.

Of course, a non root user can query the status too, but in this case
only the init.d/started/service flag is checks as non root users cannot
do the above.

Thanks

Roy
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-23 20:22     ` Roy Marples
@ 2006-12-23 21:08       ` Enrico Weigelt
  2006-12-23 21:47         ` Roy Marples
  0 siblings, 1 reply; 9+ messages in thread
From: Enrico Weigelt @ 2006-12-23 21:08 UTC (permalink / raw
  To: gentoo-dev

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

<snip>

> baselayout-1.13 is currently package.masked as there are still a few
> upgrade/downgrade issues to resolve with the 1.12 branch. However, it
> is unmasked on BSD profiles where it's enjoying great success.
> Hopefully in the new year it can be moved to ~ARCH.

Ah, I'm on x86, so I don't have it yet.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] /var/lib/init.d/* vs. pidfiles
  2006-12-23 21:08       ` Enrico Weigelt
@ 2006-12-23 21:47         ` Roy Marples
  0 siblings, 0 replies; 9+ messages in thread
From: Roy Marples @ 2006-12-23 21:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: weigelt

On Sat, 23 Dec 2006 22:08:15 +0100
Enrico Weigelt <weigelt@metux.de> wrote:
> > baselayout-1.13 is currently package.masked as there are still a few
> > upgrade/downgrade issues to resolve with the 1.12 branch. However,
> > it is unmasked on BSD profiles where it's enjoying great success.
> > Hopefully in the new year it can be moved to ~ARCH.
> 
> Ah, I'm on x86, so I don't have it yet.

Right.

So the next time you want to discuss design issues in Gentoo, it might
be a good idea to see if unstable and packaged.masked packages have
already addressed any queries you may have.

Here endeth todays lesson

Roy
-- 
gentoo-dev@gentoo.org mailing list



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

end of thread, other threads:[~2006-12-23 21:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-18 17:39 [gentoo-dev] /var/lib/init.d/* vs. pidfiles Enrico Weigelt
2006-12-18 18:05 ` Roy Marples
2006-12-23 19:50   ` Enrico Weigelt
2006-12-23 20:14     ` Mike Frysinger
2006-12-23 20:50       ` Enrico Weigelt
2006-12-23 20:22     ` Roy Marples
2006-12-23 21:08       ` Enrico Weigelt
2006-12-23 21:47         ` Roy Marples
2006-12-23 21:05     ` Roy Marples

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