dh_systemd_enable not able to disable on upgrade

Bug #1552999 reported by Scott Moser
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
init-system-helpers (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

cloud-init has a service like
== /lib/systemd/system/cloud-init.service ==
[Unit]
Description=Initial cloud-init job (metadata service crawler)
After=local-fs.target network-online.target cloud-init-local.service
Before=sshd.service sshd-keygen.service systemd-user-sessions.service
Requires=network-online.target
Wants=local-fs.target cloud-init-local.service sshd.service sshd-keygen.service

[Service]
Type=oneshot
ExecStart=/usr/bin/cloud-init init
RemainAfterExit=yes
TimeoutSec=0

[Install]
WantedBy=multi-user.target
=====

dh_systemd_enable created some files like:
 /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/cloud-init.service

I dont think that was necessary as 'WantedBy' in my service file, but thats fine.

Later I came to want to change the 'WantedBy=' to be 'WantedBy=cloud-init.target'.

When I installed the new deb, the files in /var/lib/systemd/deb-systemd-helper-enabled/ were still there
so the services where running on multi-user.target when I wanted to change that.

I've since added
override_dh_systemd_enable:
   dh_systemd_enable --no-enable

so i'm no longer enabling anything on install, but the files are still there.
The are deleted with --purge, but I need them correctly handled on upgrade.

Whats the proper way to get rid of them?

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: dh-systemd 1.28ubuntu2
ProcVersionSignature: Ubuntu 4.4.0-8.23-generic 4.4.2
Uname: Linux 4.4.0-8-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Mar 3 20:56:22 2016
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-07-23 (225 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Alpha amd64 (20150722.1)
PackageArchitecture: all
SourcePackage: init-system-helpers
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in init-system-helpers (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.