Subject: Re: [vserver] debian jessie error on vserver shutdown
From: Daniel Urist <durist@ucar.edu>
Date: Thu, 7 Jan 2016 09:31:28 -0700
Thu, 7 Jan 2016 09:31:28 -0700
If somebody wants to add it to the wiki, here's what I had to do to get a
clean shutdown of a Jessie container:

1) Disable "/etc/init.d/sendsigs" completely, so it doesn't kill off any
processes too early (vserver stop will do that anyway if it hits the
timeout).

  rm /etc/init.d/sendsigs
  update-rc.d sendsigs remove

I also removed the "halt" and "reboot" scripts, though that's probably not
necessary.

2) Add kill script links in /etc/rc6.d  for "cron", "dbus" and "ssh". These
don't exist because their init scripts have a blank "Default-Stop" header.
The simplest way to remedy this is to add override headers in
/etc/insserv/overrides and force insserv to rebuild the links; this is a
bit convoluted but is better than modifying the init scripts in case an
upgraded package has newer ones, which won't be installed if the originals
have been modified.

  for s in cron dbus ssh; do
    sed -rn -e 's/^(# Default-Stop:).*$/\1 0 1 6/' -e '/^### BEGIN INIT
INFO/,/^### END INIT INFO/p' /etc/init.d/$s > /etc/insserv/overrides/$s
  done
  /sbin/insserv -v -d



On Wed, Jan 6, 2016 at 2:04 AM, Ben Green <ben@bristolwireless.net> wrote:

> Quoting Herbert Poetzl <herbert@13thfloor.at>:
>
>
>> Thanks for the diagnostic and feedback.
>> Other debian folks might be interested in your modifications,
>> so please consider sharing them somehow.
>>
>>
> Could any resulting documentation be linked from this page please:
>
> http://linux-vserver.org/Installation_on_Debian
>
>


If somebody wants to add it to the wiki, here's what I had to do to get a clean shutdown of a Jessie container:

1) Disable "/etc/init.d/sendsigs" completely, so it doesn't kill off any processes too early (vserver stop will do that anyway if it hits the timeout).

  rm /etc/init.d/sendsigs
  update-rc.d sendsigs remove

I also removed the "halt" and "reboot" scripts, though that's probably not necessary.

2) Add kill script links in /etc/rc6.d  for "cron", "dbus" and "ssh". These don't exist because their init scripts have a blank "Default-Stop" header. The simplest way to remedy this is to add override headers in /etc/insserv/overrides and force insserv to rebuild the links; this is a bit convoluted but is better than modifying the init scripts in case an upgraded package has newer ones, which won't be installed if the originals have been modified.

  for s in cron dbus ssh; do
    sed -rn -e 's/^(# Default-Stop:).*$/\1 0 1 6/' -e '/^### BEGIN INIT INFO/,/^### END INIT INFO/p' /etc/init.d/$s > /etc/insserv/overrides/$s
  done
  /sbin/insserv -v -d



On Wed, Jan 6, 2016 at 2:04 AM, Ben Green <ben@bristolwireless.net> wrote:
Quoting Herbert Poetzl <herbert@13thfloor.at>:


Thanks for the diagnostic and feedback.
Other debian folks might be interested in your modifications,
so please consider sharing them somehow.


Could any resulting documentation be linked from this page please:

http://linux-vserver.org/Installation on Debian