maas packages incorrectly purge things needed by packages not being removed

Bug #1563337 reported by LaMont Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Undecided
Andres Rodriguez

Bug Description

Let's say I have a region-and-rack controller, and I decide to make it a region-controller only:
% sudo apt-get purge maas-rack-controller
(I expect that anything to do with the rack controller will be gone, and that the region controller remains happy)
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  maas* maas-rack-controller*
0 upgraded, 0 newly installed, 2 to remove and 18 not upgraded.
After this operation, 159 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 162688 files and directories currently installed.)
Removing maas (2.0.0~beta1+bzr4843-0ubuntu2) ...
Purging configuration files for maas (2.0.0~beta1+bzr4843-0ubuntu2) ...
Removing maas-rack-controller (2.0.0~beta1+bzr4843-0ubuntu2) ...
Purging configuration files for maas-rack-controller (2.0.0~beta1+bzr4843-0ubuntu2) ...
dpkg: warning: while removing maas-rack-controller, directory '/var/lib/maas/boot-resources' not empty so not removed

(lets see what the logs have to say:)
% ls /var/log/maas
ls: cannot access '/var/log/maas': No such file or directory

There's bug 1.

Now let's reinstall the rack controller, because that was obviously a bad idea. (or we changed our mind and it really should now be a rack-n-region controller)
(Reading database ... 162641 files and directories currently installed.)
Preparing to unpack maas_2.0.0~beta1+bzr4843-0ubuntu2_all.deb ...
Unpacking maas (2.0.0~beta1+bzr4843-0ubuntu2) ...
Selecting previously unselected package maas-rack-controller.
Preparing to unpack maas-rack-controller_2.0.0~beta1+bzr4843-0ubuntu2_all.deb ...
Unpacking maas-rack-controller (2.0.0~beta1+bzr4843-0ubuntu2) ...
Setting up maas-rack-controller (2.0.0~beta1+bzr4843-0ubuntu2) ...
touch: cannot touch '/var/log/maas/rackd.log': No such file or directory
dpkg: error processing package maas-rack-controller (--install):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of maas:
 maas depends on maas-rack-controller (= 2.0.0~beta1+bzr4843-0ubuntu2); however:
  Package maas-rack-controller is not configured yet.

dpkg: error processing package maas (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 maas-rack-controller
 maas

Turns out that maas-rack-controller also fails to create the /var/log/maas directory.

The directory should be delivered by all of the packages that create logs in it, and removed by none -- dpkg will remove it if it is empty at the time of purge. At most the packages should remove their own logs at purge, not everyone's.

Related branches

Changed in maas:
assignee: nobody → Andres Rodriguez (andreserl)
Changed in maas:
milestone: none → 2.0.0
Changed in maas:
status: New → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers