[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Idea: about package installation under chroot.

Dear Debian developers,

I would like to consult the developer community on the following issue.

Here is the story: Debian packages including daemons may be a problem for
people installing them via chroot, due to the fact that the packages will
typically try to stop and restart the daemons. In fact, this can interact
destructively with the system of the server, accidentally killing this or
that process. It may also cause the Debian package tools to crash.

Installation via chroot can be very useful for embedded systems, and also
for diskless machines that boot remotely from a server and mount the root
via NFS. If a package is being installed via chroot running in the server
it does not really make any sense to try to stop or start daemons.

Although most packages do in fact survive this process, in the sense that
the installation completes despite some errors when stopping and starting
daemons, some do cause the package tools to exit in error, leaving behind
a broken package. One example that is particularly troublesome is rwhod.

Now, all this can be avoided very simply by a line in the init.d/ script
for the daemon, checking that /proc is mounted. Since it will be mounted
on normal systems but typically not when using a chroot shell, it serves
as a flag to enable the daemon restarting procedure.

I am using successfully the following line to fix the situation in the
case of the troublesome rwhod package, near the top of the file:

test -e /proc/mounts || exit 0

So here are my questions: is there any way in which including a line like
this in the init.d/ scripts can be adopted as a standard procedure in the
future, for all Debian packages containing daemons?

Are there, perhaps, undesirable side effects to this?

Is there some other, better solution to this problem?

Solving this problem would certainly help people using chroot to install
packages and so help to extend the range of applicability and usefulness
of Debian.

        Jorge L. deLyra,  Associate Professor of Physics
            The University of Sao Paulo,  IFUSP-DFMA
       For more information: finger delyra@latt.if.usp.br

Reply to: