Bug#534504: [patch] ifupdown integration of mediatomb

Reinhard Tartler siretart at tauware.de
Sun Jan 24 17:48:51 UTC 2010


On So, Jan 24, 2010 at 13:55:41 (CET), Eric Lavarde wrote:

> Package: mediatomb
> Followup-For: Bug #534504
>
> Hello,
>
> to solve the problem described by other persons, I've created two small
> scripts that start and stop mediatomb when the interfaces are being
> brought up and down.

I understand from the context of the bug that the issue seems to be that
mediatomb must not be started before the network interface is up and
running. Why can't this be fixed be changing the initscript ordering?

> There is also a diff file for /etc/default/mediatomb that adds a
> variable DELAYED (yes/no) to disable/enable those small scripts.

The race condition is present on *all* systems, so no need to make this
fix configurable.

> Few remarks:
>
> 1. the current default is DELAYED=yes, which enables the script. It
> doesn't really hurt as mediatomb is restarted, and should work in all
> situations (with and withou NetworkManager).

What about the case that a system has 2 interfaces and mediatomb is
serving to both interfaces at the same time: Restarting one interface is
likely to disconnect users connected via that interface, but would this
affect users via the second interface as well?

> 2. I'm not sure I correctly understood the meaning of the "INTERFACE"
> variable (mine is empty), so my check might be incorrect as I only
> restart/stop if the interface given by INTERFACE is being
> stopped/started ($IFACE = $INTERFACE). Someone with more knowledge of
> mediatomb's internas might want to check if this is the right
> decision.

I guess this is a saftey guard to avoid unnecessary restarts if
mediatomb is configured to serve only on one specific interface and
other interfaces are restarted. Which seems to suggest an answer to my
previous question.

> 3. if INTERFACE=lo, then the scripts do something if and only if the 'lo'
> interface is brought up or down, again, it might not be the right logic.

what do they do exactly?

> 4. the attached tar file contains the files and diff with correct
> relative position (don't unpack in root direcotry unless it's what you want
> to do!).

I see that your if-updown scripts call the init script. That means that
depending on the context the init script is called, it behaves
differently. I find this a bit odd.

How about dumping the init script altogether and implement starting and
stopping mediatomb solely from if-updown scripts? This way there was no
need for the DELAYED=yes flag and the race condition would be avoided as
well.

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4





More information about the pkg-multimedia-maintainers mailing list