/etc/init.d/xinetd kills LXC container's xinetd

Bug #868538 reported by Ulli Horlacher
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xinetd (Debian)
Fix Released
Unknown
xinetd (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

I have an Ubuntu LXC host with several containers running internet
services via xinetd.

Sometimes the container services die without any reason and no logfile
entry. First, I thought LXC is not that stable as I hoped, but now I
found the bug inside /etc/init.d/xinetd !

The problem is: when I stop xinetd on the host with command
"/etc/init.d/xinetd stop"
this stops all LXC container xinetd processes, too!

/etc/init.d/xinetd contains bad code which does not respect the xinetd
pidfile. See "man start-stop-daemon":

  Note: unless --pidfile is specified, start-stop-daemon behaves similar
  to killall(1). start-stop-daemon will scan the process table looking
  for any processes which match the process name (...)

The following patch prevents this unwanted behaviour and let the
container's xinetd untouched:

--- /tmp/xinetd 2011-10-05 18:08:13.000000000 +0200
+++ xinetd 2011-10-05 18:23:19.000000000 +0200
@@ -17,7 +17,7 @@
 DAEMON=/usr/sbin/$NAME
 PIDFILE=/var/run/$NAME.pid

-test -x "$DAEMON" || exit 0
+test -x $DAEMON || exit 0

 test -e /etc/default/$NAME && . /etc/default/$NAME
 case "$INETD_COMPAT" in
@@ -47,18 +47,20 @@
     start)
         checkportmap
         log_daemon_msg "Starting internet superserver" "$NAME"
- start-stop-daemon --start --quiet --background --exec "$DAEMON" -- \
- -pidfile "$PIDFILE" $XINETD_OPTS
+ start-stop-daemon --start --pidfile $PIDFILE --quiet --background \
+ --exec $DAEMON -- -pidfile $PIDFILE $XINETD_OPTS
         log_end_msg $?
         ;;
     stop)
         log_daemon_msg "Stopping internet superserver" "$NAME"
- start-stop-daemon --stop --signal 3 --quiet --oknodo --exec "$DAEMON"
+ start-stop-daemon --stop --pidfile $PIDFILE --signal 3 --quiet \
+ --oknodo --exec $DAEMON
         log_end_msg $?
         ;;
     reload)
         log_daemon_msg "Reloading internet superserver configuration" "$NAME"
- start-stop-daemon --stop --signal 1 --quiet --oknodo --exec "$DAEMON"
+ start-stop-daemon --stop --pidfile $PIDFILE --signal 1 --quiet \
+ --oknodo --exec $DAEMON
         log_end_msg $?
         ;;
     restart|force-reload)
@@ -66,7 +68,7 @@
         $0 start
         ;;
     status)
- status_of_proc -p "$PIDFILE" "$DAEMON" xinetd && exit 0 || exit $?
+ status_of_proc -p $PIDFILE $DAEMON xinetd && exit 0 || exit $?
        ;;
     *)
         echo "Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart|status}"

--
Ullrich Horlacher Server- und Arbeitsplatzsysteme
Rechenzentrum E-Mail: <email address hidden>
Universitaet Stuttgart Tel: ++49-711-685-65868
Allmandring 30 Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.rus.uni-stuttgart.de/

Tags: patch

Related branches

Revision history for this message
Ulli Horlacher (framstag) wrote :

Sorry, forgot to mention: this is on Ubuntu 10.04

Revision history for this message
Ulli Horlacher (framstag) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "xinetd.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Robie Basak (racb) wrote :

Setting Importance to Low as this bug applies only to an unusual configuration and there is a workaround available.

Changed in xinetd (Ubuntu):
importance: Undecided → Low
Changed in lxc:
status: New → Invalid
status: Invalid → New
Revision history for this message
Ulli Horlacher (framstag) wrote : Re: [Bug 868538] Re: /etc/init.d/xinetd kills LXC container's xinetd

On Thu 2011-10-06 (09:41), Robie Basak wrote:
> Setting Importance to Low as this bug applies only to an unusual
> configuration and there is a workaround available.

LXC is not unusual, because it is part of LTS!
A LTS package should not break another package!
And what workaround?

--
Ullrich Horlacher Server- und Arbeitsplatzsysteme
Rechenzentrum E-Mail: <email address hidden>
Universitaet Stuttgart Tel: ++49-711-685-65868
Allmandring 30 Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.rus.uni-stuttgart.de/

Changed in xinetd (Ubuntu):
status: New → Confirmed
Changed in xinetd (Debian):
status: Unknown → New
LtWorf (tiposchi)
Changed in xinetd (Ubuntu):
status: Confirmed → Fix Committed
LtWorf (tiposchi)
Changed in xinetd (Ubuntu):
status: Fix Committed → Fix Released
Changed in xinetd (Debian):
status: New → Fix Released
no longer affects: lxc
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.