my nspawn failed to reproduce this (probably too old on xenial), but
doing the same in a chroot instead of systemd-nspawn works fine.

Setting up mysql-server-5.7 (5.7.21-1ubuntu1) ...
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                        
                                                           [ OK ] 
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf 
(my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot open /proc/net/unix: No such file or directory
Cannot open /proc/mounts
Created symlink /etc/systemd/system/ → 

So it seems to be something special to nspawn.

The code in the postinst that does this looks like that.

  local tmpdir=$1
  # Send kill signal
  server_pid=$(cat "$tmpdir/")
  kill "$server_pid"

  for i in $(seq 1 60); do
    sleep 0.1 # A full second is too long, but we need to give the server 
_some_ time.
    if ! $(ps $server_pid >/dev/null 2>&1); then
      return 0
    sleep 1
  # The server hasn't shut down in a timely manner
  echo "Error: Unable to shut down server with process id $server_pid" >&2
  return 1

So it essentially is "just" a kill and waiting until the pid is gone

Knowing that a few questions:
1. if you run an interactive bash in nspawn and do the same install would that 
2. if (1) is the same, then after the fail what is going on with the pid it 
failed on
   2.1 any dmesg/syslog entries about it?
   2.2 if you send a kill manually what happens?
   2.3 is the process in any odd state (a full ps axlf from inside the nspawn 
might be useful)
Setting up a bionic to check the nspawn there ...

You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

  installation of mysql-server fails because postinst fails to shut down

To manage notifications about this bug go to:

ubuntu-bugs mailing list

Reply via email to