[Lxc-users] Ubuntu /etc/init.d/xinetd kills container's xinetd

Stéphane Graber stgraber at ubuntu.com
Thu Oct 6 01:48:38 UTC 2011


On 10/05/2011 12:43 PM, Ulli Horlacher wrote:
>
> I have an Ubuntu LXC hosts with several containers running internet
> services via xinetd.
>
> Sometimes the container services died 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 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:
>
> --- /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}"
>
>

Hi!

Can you file a bug here: http://launchpad.net/ubuntu/+source/xinetd/+filebug

Then attach the patch to the bug making sure that it's flagged as a 
patch. This should ensure someone will look at it, sadly not for Oneiric 
(11.10) but hopefully for Precise (12.04).

Launchpad lets you mark a bug as affecting multiple packages, so I'd 
suggest you add a "task" to any other package showing the same bug so 
they can easily be tracked and fixed (though a good part of that will 
probably have to happen in Debian).

Thanks


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com




More information about the lxc-users mailing list