Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 336615 - media-sound/mpd sometimes fails to restart
Summary: media-sound/mpd sometimes fails to restart
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Christoph Mende (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 15:30 UTC by DEMAINE Benoît-Pierre, aka DoubleHP
Modified: 2011-03-06 08:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/tmp/emerge--info (emerge--info,14.85 KB, text/plain)
2010-09-09 15:31 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DEMAINE Benoît-Pierre, aka DoubleHP 2010-09-09 15:30:40 UTC
part of /etc/conf.d/local.start

swissgrid_cmd &
weather_refresh &
ups_refresh &
{
        sleep 120
        /bin/zcat /var/log/messages-2* | grep "XXX" >/var/log/xxx
        /bin/cat /var/log/messages | grep "XXY" >>/var/log/xxx
} &
/etc/init.d/mpd restart
/etc/init.d/samba restart

in short, to WA several XEN bug 293717 ... i have to restart several services during boot.

Some times, MPD fails to restart:

 * Starting vixie-cron ...                [ ok ]
 * Starting Xen domains from /etc/xen/auto
 * Creating screen session to hold domain consoles ...      [ ok ]
 * Starting local ...
 * Stopping Music Player Daemon ...         [ ok ]
 * Starting Music Player Daemon ...
   listen: Failed to listen on localhost (line 70): Address already in use
   /etc/init.d/mpd: line 20:  9263 Aborted                 /usr/bin/mpd /etc/mpd.conf     [ !! ]
 * ERROR: mpd failed to start
 * samba -> start: smbd ...            [ ok ]
 * samba -> start: nmbd ...       [ ok ]

Typically, this happens when system is under heavy load; not by the load average value, but, instant load in the previous seconds.

It may happend with some other services, but, most frequently MPD. Also Samba from time to time IIRC.

The bug is not reported against MPD package or ebuild, but, against the way Gentoo manages and implements the "restart" feature/function: after stop, the system does not way long enough to perform the start. Or does not way "properly" that the PID has exited: sending a kill signal is not enough: if a process catches the kill signal, it can refuse to die, or wait some time. Before the stop command returns, we need to wait for the PID to die (but only in the case of a restart; waiting for this during a normal shutdown is not desirable).

"port in use" is a very explicit issue.

The bug is not specific to boot time. It can also happen when i need to restart mpd during normal use, when the computer is doing very heavy work (99%CPU + 99% MEM + heavy work on way) since short time. When the load average (value in my permanent "top" window) had time to increase, I never see this happen. Only happen when i run a restart just after starting an heavy task.
Comment 1 DEMAINE Benoît-Pierre, aka DoubleHP 2010-09-09 15:31:06 UTC
Created attachment 246613 [details]
/tmp/emerge--info
Comment 2 Christoph Mende (RETIRED) gentoo-dev 2011-02-20 12:36:23 UTC
Can you please test this with mpd-0.16? Judging from the source this shouldn't happen.
Comment 3 Christoph Mende (RETIRED) gentoo-dev 2011-03-06 08:49:30 UTC
Please reopen if this still happens with 0.16. I cannot reproduce it.