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

Re: Invoking ‘init’ from an init.d script (Wheezy)

On Wed, Jun 3, 2015 at 6:09 PM, Konstantin Khomoutov
<flatworm@users.sourceforge.net> wrote:
> On Wed, 3 Jun 2015 17:26:21 +0200
> Alexander Thomas <alexander.thomas+ddml@esaturnus.com> wrote:
> [...]
> > The long story:
> >
> > We have a setup with multiple servers (running Wheezy). When booting,
> > the servers check whether updates are available on a master server. If
> > available, they are pulled in through a dist-upgrade. This
> > check/update needs to happen before any of the normal services are
> > started, to avoid the need of taking down everything and then starting
> > it back up after the update.
> [...]
> Wouldn't it be simpler to implement this check and update using
> initramfs hooks?  You could bind-mount /dev, /sys and /proc to
> the root filesystem, chroot there and run there a script which would
> check for updates, apply them, if any, and exit.  After that the system
> would just resume booting.

That would be an option, but it might still cause the same problem of
apt-get hanging as we currently experience when doing the update
before runlevel S.

We looked deeper into this and found out that apt-get always hangs
while installing a package before the first runlevel switch. An strace
reveals an endless loop of SIGCONT and ioctl calls. Running other
commands that use ioctl also results in a hang, so the controlling
terminal seems to lack certain capabilities at this stage. We have
found a workaround: we spawn a new terminal with agetty and run the
update script in there, this allows to perform the apt-get
dist-upgrade in runlevel S and avoid the init 1 hack.


Reply to: