zfsonlinux / pkg-zfs

Native ZFS packaging for Debian and Ubuntu
https://launchpad.net/~zfs-native/+archive/daily
308 stars 55 forks source link

wrong dh_systemd_enable/start usage in 0.6.5.6-3-wheezy #203

Closed Fabian-Gruenbichler closed 8 years ago

Fabian-Gruenbichler commented 8 years ago

Hello,

it seems that the current debian/wheezy tag is missing changes in debian/rules to handle the moved systemd unit files (from etc/ to contrib/). The following was included in the latest jessie packages:

commit c07d163262e2b0236e450f1ab6cc20c89efab954
Refs: <master/debian/jessie/0.6.5.6-1>
Author:     Turbo Fredriksson <turbo@bayour.com>
AuthorDate: Wed Mar 30 16:17:53 2016 +0200
Commit:     Turbo Fredriksson <turbo@bayour.com>
CommitDate: Mon Apr 4 23:00:23 2016 +0200

    Additional patches for the ZoL packages added.

    * Include fix from https://github.com/zfsonlinux/zfs/issues/4474.
    * Include fix for https://github.com/zfsonlinux/pkg-zfs/issues/196

---
 debian/rules | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index 697d92d..3c0b974 100755
--- a/debian/rules
+++ b/debian/rules
@@ -161,7 +161,7 @@ override_dh_auto_install:

 override_dh_installinit:
        @# Install systemd files
-       dh_systemd_enable -pzfsutils etc/systemd/system/zfs.target
+       dh_systemd_enable -pzfsutils contrib/systemd/system/zfs.target

        @# Install the /etc/default/zfs options file.
        install -m 644 $(CURDIR)/contrib/shell-common/zfs $(CURDIR)/debian/zfsutils/etc/default/
@@ -210,7 +210,7 @@ endif

        @# Add systemd snippets to post/pre inst/rm files
        dh_systemd_start --no-restart-on-upgrade --no-start \
-         -pzfsutils etc/systemd/system/zfs.target
+         -pzfsutils contrib/systemd/system/zfs.target

        @# Add a dummy (link to /dev/null) for zfs-import.service
        ln -s /dev/null $(CURDIR)/debian/zfsutils/lib/systemd/system/zfs-import.service

Because dh_systemd_enable and dh_systemd_start are called with the wrong zfs.target path in the wheezy package, the postinst/postrm/preinst scripts are missing (some) systemd integration parts. I guess not many people use wheezy+zfs+systemd, but I decided to file this issue in case something else is missing as well.

FransUrbo commented 8 years ago

I can't see this change. My directory show:

DebianZFS-Jessie-Devel-Released:/usr/src/pkg-zfs# git blame debian/rules | grep ' etc/'
DebianZFS-Jessie-Devel-Released:/usr/src/pkg-zfs# git blame debian/rules | grep ' contrib/'
c07d1632 (Turbo Fredriksson 2016-03-30 16:17:53 +0200 164)      dh_systemd_enable -pzfsutils contrib/systemd/system/zfs.target
c07d1632 (Turbo Fredriksson 2016-03-30 16:17:53 +0200 213)        -pzfsutils contrib/systemd/system/zfs.target
commit c07d163262e2b0236e450f1ab6cc20c89efab954
Author: Turbo Fredriksson <turbo@bayour.com>
Date:   Wed Mar 30 16:17:53 2016 +0200

    Additional patches for the ZoL packages added.

    * Include fix from https://github.com/zfsonlinux/zfs/issues/4474.
    * Include fix for https://github.com/zfsonlinux/pkg-zfs/issues/196

I'm closing this. If you think this is in error, feel free to reopen and give more information.

Fabian-Gruenbichler commented 8 years ago
git checkout master/debian/jessie/0.6.5.6-5
git diff master/debian/wheezy/0.6.5.6-5-wheezy.. debian/patches

only timestamp related diffs - all patches identical! so this means that both jessie and wheezy have identical patches/PRs moving the init stuff from etc/ to contrib. if we look at debian/rules now:

git checkout master/debian/jessie/0.6.5.6-5
git diff master/debian/wheezy/0.6.5.6-5-wheezy.. debian/rules
diff --git a/debian/rules b/debian/rules
index 697d92d..3c0b974 100755
--- a/debian/rules
+++ b/debian/rules
@@ -161,7 +161,7 @@ override_dh_auto_install:

 override_dh_installinit:
    @# Install systemd files
-   dh_systemd_enable -pzfsutils etc/systemd/system/zfs.target
+   dh_systemd_enable -pzfsutils contrib/systemd/system/zfs.target

    @# Install the /etc/default/zfs options file.
    install -m 644 $(CURDIR)/contrib/shell-common/zfs $(CURDIR)/debian/zfsutils/etc/default/
@@ -210,7 +210,7 @@ endif

    @# Add systemd snippets to post/pre inst/rm files
    dh_systemd_start --no-restart-on-upgrade --no-start \
-     -pzfsutils etc/systemd/system/zfs.target
+     -pzfsutils contrib/systemd/system/zfs.target

    @# Add a dummy (link to /dev/null) for zfs-import.service
    ln -s /dev/null $(CURDIR)/debian/zfsutils/lib/systemd/system/zfs-import.service

we see that wheezy calls dh_systemd_XX with the old, pre-PR path, which leads to wrong postinst/.. control files.

git checkout master/debian/jessie/0.6.5.6-5
git blame -L 164,164 -L 213,213 debian/rules
c07d1632 (Turbo Fredriksson 2016-03-30 16:17:53 +0200 164)      dh_systemd_enable -pzfsutils contrib/systemd/system/zfs.target
c07d1632 (Turbo Fredriksson 2016-03-30 16:17:53 +0200 213)        -pzfsutils contrib/systemd/system/zfs.target

This two lines of change are missing in the wheezy tag.

git show c07d1632
commit c07d163262e2b0236e450f1ab6cc20c89efab954
Author: Turbo Fredriksson <turbo@bayour.com>
Date:   Wed Mar 30 16:17:53 2016 +0200

    Additional patches for the ZoL packages added.

    * Include fix from https://github.com/zfsonlinux/zfs/issues/4474.
    * Include fix for https://github.com/zfsonlinux/pkg-zfs/issues/196
FransUrbo commented 8 years ago

Ah, now I see it!

FransUrbo commented 8 years ago

Should be fixed in v0.6.5.6-7-wheezy.