Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent /etc/init.d/zfs-import from running with systemd #3839

Closed
wants to merge 2 commits into from
Closed

prevent /etc/init.d/zfs-import from running with systemd #3839

wants to merge 2 commits into from

Conversation

ggzengel
Copy link
Contributor

#3837
For systems with systemd in sysv init compatibility mode you have to prevent that services in /etc/init.d will be executed if there is a equivalent in systemd.
There is zfs-import without a corresponding systemd service.

#3837
For systems with systemd in sysv init compatibility mode you have to prevent that services in /etc/init.d will be executed if there is a equivalent in systemd.
There is zfs-import without a corresponding systemd service.
#3837
For systems with systemd in sysv init compatibility mode you have to prevent that services in /etc/init.d will be executed if there is a equivalent in systemd.
There is zfs-import without a corresponding systemd service.
@FransUrbo
Copy link
Contributor

The description of the issue is misleading at best.

IF I have understand your problem correctly (and I'm not sure I have), once systemd is installed/active, NO script is executed from /etc/init.d! This is how systemd works...

Instead, any missing systemd service file will be auto generated by a systemd generator (/lib/systemd/system-generators). THOSE in turn is run/executed/something by systemd.

This leads to (and I have yet to verify that this can actually happen - I have been unable to reproduce the problem) the already existing scripts zfs-import-cache.service and zfs-import-scan.service conflicting with the newly created zfs-import.service (this is where the PR makes sense - systemd will notice that there is a zfs-import script, but no corresponding zfs-import.service file so it will auto generate one).

As I've said in the pkg-zfs issue, I can't rule out user error or a Debian GNU/Linux tool issue. I've been supplying both SYSV init scripts and systemd service and rules files for over a year for both Wheezy and Jessie and no one have reported anything like this. I'm pretty sure a lot of people run my packages on Jessie with systemd. SOMEONE should have noticed this before...

@FransUrbo
Copy link
Contributor

I am not technically against this PR, it makes sense and looks good to me. HOWEVER, I'm afraid that it can/might shield us from the real issue.

@FransUrbo
Copy link
Contributor

@dajhorn How are you doing in your Ubuntu packages? Are you supplying both SYSV and systemd files in the same package? I assume that you haven't seen this problem either?

@FransUrbo
Copy link
Contributor

This is my old Jessie host, which was running version 0.6.3. I just upgraded it to latest Jessie and latest ZoL packages.

This is what I see after the upgrade:

jessie-systemd:/usr/src# find /etc/init.d/ /lib/systemd/system -name 'z*' | sort
/etc/init.d/zfs-import
/etc/init.d/zfs-mount
/etc/init.d/zfs-share
/etc/init.d/zfs-zed
/lib/systemd/system/zed.service
/lib/systemd/system/zfs-import-cache.service
/lib/systemd/system/zfs-import-scan.service
/lib/systemd/system/zfs-mount.service
/lib/systemd/system/zfs-share.service
/lib/systemd/system/zfs.target

So in TWO cases, I don't see this problem: In the zfs-zed to zfs-zed.service conversion and for the zfs-import to zfs-import.service. So I still can't reproduce this.

PS. The zed.service file is because of #3824.

@ggzengel
Copy link
Contributor Author

As I've said in the pkg-zfs issue, I can't rule out user error or a Debian GNU/Linux tool issue. I've been supplying both SYSV init scripts and systemd service and rules files for over a year for both Wheezy and Jessie and no one have reported anything like this. I'm pretty sure a lot of people run my packages on Jessie with systemd. SOMEONE should have noticed this before...

@FransUrbo In 0.6.4 there was no zfs-import:

root@xenserver2:~# ls -la /etc/init.d/z*
-rwxr-xr-x 1 root root 3908 May 28 14:25 /etc/init.d/zed
-rwxr-xr-x 1 root root 5870 May 28 14:25 /etc/init.d/zfs-mount
-rwxr-xr-x 1 root root 2310 May 28 14:25 /etc/init.d/zfs-share

So how could systemd start zfs-import?

SOMEONE should have noticed this before...

Nobody will have a real problem because zpool import is run twice.

Please run on your system:

systemctl list-units | grep ^\\W*z

How are you doing in your Ubuntu packages?

That's what I wanted to know. I didn't found *.service in Ubuntu package.

I've been supplying both SYSV init scripts and systemd service and rules files for over a year for both Wheezy and Jessie

This file exists since Mai.

History for zfs/etc/init.d/zfs-import.in
Commits on Sep 2, 2015

    @MrStaticVoid @behlendorf

    Reorder zfs-* services to allow /var on separate dataset …
    MrStaticVoid authored 26 days ago 

behlendorf committed 23 days ago

Commits on Jul 25, 2015

    @FransUrbo @behlendorf

    Fix some minor issues with the SYSV init and initramfs scripts. …
    FransUrbo authored on Jul 24 

behlendorf committed on Jul 25

Commits on Jun 29, 2015

    @FransUrbo @behlendorf

    Add /dev/mapper to the list of possible sources for pool devices. …
    FransUrbo authored on Jun 27 

behlendorf committed on Jun 29

Commits on Jun 5, 2015

    @FransUrbo @behlendorf

    SYSV init script fixes. …
    FransUrbo authored on Jun 2 

behlendorf committed on Jun 5

Commits on May 28, 2015

    @FransUrbo @behlendorf

    Base init scripts for SYSV systems …
    FransUrbo authored on Apr 23 

behlendorf committed on May 28

@dajhorn
Copy link
Contributor

dajhorn commented Sep 26, 2015

@dajhorn How are you doing in your Ubuntu packages?

The PPA installs the systemd units that are currently bundled with ZoL, but as an overlay component instead of a source component so that debhelper will manage them. (NB: zfsonlinux/pkg-zfs#145)

Are you supplying both SYSV and systemd files in the same package?

No, sysv is retired and unsupported. Existing /etc/init.d scripts for ZoL are preserved, but they are not installed by recent packages.

The packages for Ubuntu currently support systemd and upstart, which themselves are mutually exclusive startup modes on recent Ubuntu releases.

I assume that you haven't seen this problem either?

Not as reported by @ggzengel, if only because anything sysv is already twice deprecated on the Ubuntu platform.

@FransUrbo
Copy link
Contributor

Ok, thanx @dajhorn.

The plot thickens though:

jessie-systemd:/usr/src# systemctl list-units | grep ^\\W*z
  zed.service                                                                              loaded active running   ZFS Event Daemon (zed)
  zfs-import-cache.service                                                                 loaded active exited    Import ZFS pools by cache file
  zfs-import.service                                                                       loaded active exited    LSB: Import ZFS pools
  zfs-mount.service                                                                        loaded active exited    Mount ZFS filesystems
  zfs-share.service                                                                        loaded active exited    ZFS file system shares
● zfs-zed.service                                                                          loaded failed failed    LSB: ZFS Event Daemon
  zfs.target                                                                               loaded active active    ZFS startup target
jessie-systemd:/usr/src# find /var /run -name 'z*.service*'
/run/systemd/generator.late/zfs-import.service
/run/systemd/generator.late/runlevel5.target.wants/zfs-zed.service
/run/systemd/generator.late/runlevel4.target.wants/zfs-zed.service
/run/systemd/generator.late/runlevel3.target.wants/zfs-zed.service
/run/systemd/generator.late/runlevel2.target.wants/zfs-zed.service
/run/systemd/generator.late/zfs-zed.service
/run/systemd/generator.late/sysinit.target.wants/zfs-import.service
jessie-systemd:/usr/src# head /run/systemd/generator.late/zfs-import.service
# Automatically generated by systemd-sysv-generator

[Unit]
SourcePath=/etc/init.d/zfs-import
Description=LSB: Import ZFS pools
DefaultDependencies=no
Before=checkfs.service sysinit.target shutdown.target
After=mtab.service
Conflicts=shutdown.target

So it seems I have this issue to, but I looked very carefully when it booted, and I could not see the import run twice. I'll see if I can log it...

@ggzengel
Copy link
Contributor Author

@FransUrbo :-)
You can see it only if import needs "very" long (about 5 sec) and no other tasks are running. Systemd will change display every 2 sec.
My ZFS sits on top of encrypted LVM with more than 40TB and a lot of file systems and snapshots. So it needs some time to import. And after this crash #3806 I watched very carefully what happened on boot.

@FransUrbo
Copy link
Contributor

Ah, ok thanx. That explains a lot :). So NOT a user error, or Debian GNU/Linux tool problem :D

I've been reading up on systemd and I think I've found a more correct/better solution.

Unless @behlendorf consider this [PR] a good thing to do generically, the correct way (at least in Debian GNU/Linux) would be to disable the zfs-import auto generation in the post install script:

[…]
# Make sure that systemd isn't auto generating a service file                                                                                                 
# for/etc/init.d/zfs-import - we already have service files                                                                                                   
# that are appropriate.                                                                                                                                       
systemctl mask zfs-import

I have yet to actually test that in the package, BUT running that command in the shell gives this after a reboot:

jessie-systemd:/usr/src# systemctl list-units | grep ^\\W*z
  zfs-import-scan.service                                                                  loaded active exited    Import ZFS pools by device scanning
  zfs-mount.service                                                                        loaded active exited    Mount ZFS filesystems
  zfs-share.service                                                                        loaded active exited    ZFS file system shares
  zfs-zed.service                                                                          loaded active running   LSB: ZFS Event Daemon
  zfs.target                                                                               loaded active active    ZFS startup target

While I was at it, I also ran systemctl mask zed, which shouldn't be needed once #3824 is accepted. I could have kept the native zed service file, but this looked prettier :)

@ggzengel what do you think?

@ggzengel
Copy link
Contributor Author

So you have to decide on package install which init system is actually used, this is like deleting or not installing this file.
I think you should systemd give the right info and let systemd decide what to do.
With my patch it's possible to migrate from init to systemd without any changes. With your patch the user has to run "systemctl mask zfs-import" manually. Who wants this?
It's still possible to install Jessie without systemd and migrate later.

Mask one or more unit files, as specified on the command line. This will link these units to /dev/null, making it impossible to start them. This is a stronger version of disable, since it prohibits all kinds of activation of the unit, including manual activation.

To disable (and mask) or enable services is an user decision to configure the system. It's nothing to always prevent services from running.
Users shouldn't have knowledge about services. If there is a service a user can enable it and if it shouldn’t run you have to adjust the dependencies.

@FransUrbo
Copy link
Contributor

That's my point. I put it in the postinst script so that takes care of everything.

Since I install both SYSV and systemd scripts on the same system, the Debian GNU/Linux tools takes care of everything. If you look at /var/lib/dpkg/info/zfsutils.postinst, you'll see how both the SYSV and systemd 'stuff' is done.

Correcting the section to:

if type systemctl > /dev/null 2>&1 ; then
        systemctl mask zfs-import
fi

will make sure that it's only done if systemd is enabled/available. Doing it this way does not touch /etc/init.d/zfs-import, it ONLY creates a zfs-import.service link to /dev/null, making sure that system doesn't touch it. Only needs to be done once...

@ggzengel
Copy link
Contributor Author

But user can enable it but shouldn't. With my solution it doesn't matter if it's enabled. It doesn't run.
If there is no systemd there is no systemctl and if somebody install systemd later the service is not masked because postinst won't run again.
Another solution is like ubuntu it does. Don't install init scripts if systemd installed.
Make two extra packages zfsutil-sysv and zfsutil-systemd. zfsutil depends on one from both. zfsutil-sysv conflicts with systemd and zfsutil-systemd conflicts with sysv-init.

I think my solution works with most distributions and package maintainers have less complexity and less work.

@FransUrbo
Copy link
Contributor

If the mask is run once at install time, it doesn't matter if the system is using SYSV or systemd when run. The link (and all the files for both ways) is still there. So once a change from SYSV to systemd is done, that dummy file (link) is there and it won't ever auto generate…

I'm not absolutly convinced that this is something we (ZFS On Linux) should deal with. For me, it's more of a packaging thing. And installing both in a package is the correct way to do it. It will guarantee that things will work smoothly no matter which startup system one uses. Or migrates to/from...

And I'm not creating two ADDITIONAL packages with only four or five files in them! It's to many packages as it is! Having to keep track of installing, deinstalling or reinstalling specific packages when (if!) going back and forth between them is way to much work… People WILL forget about that. So no, no additional packages. This needs to be done automatic.

It's either your way, making it global for everyone (whether it's needed or not), or my way. Let's wait and see what @behlendorf thinks about this. I'm not opposed to your way, I'm just not convinced ZoL should deal with this…

I can't do it the Ubuntu way either, because SYSV isn't deprecated in Debian GNU/Linux. Yet! And lets pray to every deity ever thought up that it never will!

@ggzengel
Copy link
Contributor Author

Which systemctl?

root@server-ex2:~# uname -a
Linux server-ex2 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux
root@server-ex2:~# which systemctl
root@server-ex2:~# 

@FransUrbo
Copy link
Contributor

Is that on a systemd enabled system?

@FransUrbo
Copy link
Contributor

With the help from "ansgar" on #debian-devel, a better solution is to ship a zfs-import.service -> /dev/null symlink in /lib/systemd/system.

@ggzengel
Copy link
Contributor Author

it doesn't matter if the system is using SYSV or systemd

No, it wasn't a systemd enabled system. But upgrade to jessie will be run after zfsutils.postinst if zfsutils are not upgraded. So it didn't mask in this special case. I think it should always match.

That's what I said before on zfsonlinux/pkg-zfs#172 (comment): Use a dummy for zfs-import.service. I didn't think about a link to /dev/null, but that's it. But how to put it to the repository that every maintainer will understand this?

@FransUrbo
Copy link
Contributor

Ok, fair enough. I think (thought) about "dummy file" differently…

First we need to figure out if this occur on every distribution. Debian GNU/Linux have a bunch of extra patches to the systemd sources that might be the source of this. Let's stop here and get some more input… We now have several ways to solving this, so let's hear what everyone else is saying...

@ggzengel
Copy link
Contributor Author

  1. This generator script is standard on systemd and normally enabled. I expect that most distributions will have the same problem if the maintainer will put both files. I don't know if ubuntu disable the generator script, because if there are no init files then the generator file will do nothing.
  2. There are no side effects with a link to /dev/null and "official" documented:

You can mask a service. This is like disabling a service, but on steroids. It not only makes sure that service is not started automatically anymore, but even ensures that a service cannot even be started manually anymore. This is a bit of a hidden feature in systemd, since it is not commonly useful and might be confusing the user. But here's how you do it:
$ ln -s /dev/null /etc/systemd/system/ntpd.service
$ systemctl daemon-reload

So lets do it for everyone, even if there is only one more distribution or somebody installs plain ZFS from repository. It has no side-effect.

@FransUrbo
Copy link
Contributor

So lets do it for everyone, even if there is only one more distribution or somebody installs plain ZFS from repository. It has no side-effect.

That's the thing. Anyone installing from source will NOT have this problem, because the configure script will recognize if this is a SYSV or systemd system and ONLY install the relevant parts.

Which is why I'm not sure doing it (either create a dummy zfs-import.service link or using your way of setting up Conflicts entries) in ZoL is the best solution…

Also, Gentoo for example don't use systemd at all (the only positive site of that distribution :D, neither does many others so they won't have this problem either. And for those distribution packages that only installs the relevant parts depending on how/where it's installed on won't need this either…

There are many reason to consider this a packaging/distribution problem and not that many to consider it a ZoL responsibility...

PS. As dajhorn said earlier, the Ubuntu packages don't have this problem because he's not installing the SYSV scripts (because SYSV is deprecated in Ubuntu).

@SpComb
Copy link

SpComb commented Sep 27, 2015

Masking out zfs-import.service and relying on the current zfs-import-cache/scan.service will leave the zpools unexported at shutdown, as this is currently only implemented in /etc/init.d/zfs-import stop?

EDIT: See #3836

@behlendorf
Copy link
Contributor

Was there agreement in this issue about what the right fix for this is?

@behlendorf behlendorf added this to the 0.6.5.3 milestone Sep 30, 2015
@FransUrbo
Copy link
Contributor

No. We have three (I think it was) ways of solving this. They're all good.

The primary/first question we need to decide is if this is a ZoL issue or a packaging/downstream issue… I've voted for the latter...

@ggzengel
Copy link
Contributor Author

Where is @FransUrbo? I can't see his posts nor account.

  1. Conflicts=zfs-import.service
    • But this doesn't prevent zfs-import.service running manually. If somebody starting zfs-import systemd will stop zfs-import-cache. That's not good.
  2. systemctl mask zfs-import.service
    • On Debian and other systems which can change between systemd and sysv: This doesn't mask zfs-import.service while installing zfstools if systemd is not installed. If you upgrade/change later to systemd zfs-import is still unmasked.
  3. Create soft link from /lib/systemd/system/zfs-import.serve to /dev/null while installing zfs.
    • This will always mask zfs-import (for systemd) even if systemd is not installed.
    • Without systemd: /etc/init.d/zfs-import will be used
    • With systemd: /etc/init.d/zfs-import will be blocked. "This is like disabling a service, but on steroids."

Number 3 is the solution which is used on debian:

# find /lib/systemd/system -lname /dev/null -ls
2098387    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/bootlogs.service -> /dev/null
2098377    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/stop-bootlogd-single.service -> /dev/null
2097222    0 lrwxrwxrwx   1 root     root            9 Sep  3 18:24 /lib/systemd/system/screen-cleanup.service -> /dev/null
2098350    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/sendsigs.service -> /dev/null
2098275    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/hwclockfirst.service -> /dev/null
2098509    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/halt.service -> /dev/null
2098517    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/mountdevsubfs.service -> /dev/null
2098469    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/motd.service -> /dev/null
2098454    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/hostname.service -> /dev/null
2098380    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/umountroot.service -> /dev/null
2097394    0 lrwxrwxrwx   1 root     root            9 Sep 26 14:48 /lib/systemd/system/zfs-import.service -> /dev/null
2098506    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/bootmisc.service -> /dev/null
2098353    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/umountfs.service -> /dev/null
2098498    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/cryptdisks.service -> /dev/null
2098304    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/killprocs.service -> /dev/null
2098527    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/single.service -> /dev/null
2098512    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/checkfs.service -> /dev/null
2098313    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/cryptdisks-early.service -> /dev/null
2098486    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/bootlogd.service -> /dev/null
2098519    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/fuse.service -> /dev/null
2098525    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/reboot.service -> /dev/null
2098332    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/mountnfs-bootclean.service -> /dev/null
2098326    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/mountall-bootclean.service -> /dev/null
2098447    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/checkroot.service -> /dev/null
2098329    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/hwclock.service -> /dev/null
2098319    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/rmnologin.service -> /dev/null
2098537    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/mountkernfs.service -> /dev/null
2098523    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/checkroot-bootclean.service -> /dev/null
2098466    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/mountall.service -> /dev/null
2098298    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/x11-common.service -> /dev/null
2098457    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/mountnfs.service -> /dev/null
2098316    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/umountnfs.service -> /dev/null
2098451    0 lrwxrwxrwx   1 root     root            9 Aug 29 15:45 /lib/systemd/system/stop-bootlogd.service -> /dev/null

Now there a 3 options to realize:

  1. Install only packages with either sysv or systemd
    • Most packaging systems can resolve dependencies to consider which package are the right one.
    • This makes more work for maintainers.
  2. The maintainers have to create the soft link.
    • Do all maintainers know about the problems with systemd and sysv compatibility?
    • There must be a readme about this.
  3. Put the soft link into zfs repo even if it's not necessary for most systems.

@FransUrbo
Copy link
Contributor

GitHub thought I was a robot there for a while. Should be fixed now.

When you put it like that, the only way forward (which is the one I've used in my latest 0.6.5.2 which is building now) is to create the soft link. This is also the one recommended by other Debian GNU/Linux maintainers.

As for your other three options (where to put it), I've said my opinion and I stand by it. ZoL should provide, as much as possible, a uniform environment. Which is the reason why we provide SYSV scripts, systemd service files, initramfs scripts and dracut scripts. Making allowances for quirks in either software is in my opinion out of scope for the ZFS On Linux project.

@ggzengel
Copy link
Contributor Author

@FransUrbo So you say point 2: The maintainers have to create the soft link.
I agree.
Can somebody put a readme for maintainer into repository or should they have the same experience like us (Turbo and me)?
My English is not so good to put a readme and I don't know where to put exactly some note.

@ggzengel
Copy link
Contributor Author

What should I do with this issue?

@FransUrbo
Copy link
Contributor

Leave it open for now and see what @behlendorf have to say about it. He's the one with the final say on it.

@ryao
Copy link
Contributor

ryao commented Oct 1, 2015

@SpComb Exporting the pool at shutdown is incorrect. The import associates the pool with the system to say that it should persistantly appear on every boot. The export disassociates it so that does not happen anymore. The systemd zfs-import-cache.service unit file correctly calls @sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN to load the imported pools into the kernel during boot. This mechanism was broken in 0.6.5 due to inadequate review letting a regression slip by. #3800 should address it soon.

@ryao
Copy link
Contributor

ryao commented Oct 1, 2015

It is worth mentioning that I tried exporting pools at shutdown in Gentoo in 2012 and abandoned it after finding that it caused far more problems than it solved:

https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-shutdown?view=log&pathrev=MAIN

@behlendorf
Copy link
Contributor

It's worth mentioning that not exporting a pool during shutdown may cause GRUB to not be able to read it. For root pools this can result in a system which doesn't boot. I'm not sure if this issue still exists in the very latest GRUB but it certainly exists in the version of GRUB shipped by many distributions.

@SpComb
Copy link

SpComb commented Oct 5, 2015

@SpComb Exporting the pool at shutdown is incorrect. The import associates the pool with the system to say that it should persistantly appear on every boot. The export disassociates it so that does not happen anymore

Yeah, I'm not sure if exporting is correct or not - but it's inconsistent with what the existing /etc/init.d script does.

@FransUrbo
Copy link
Contributor

Yeah, I'm not sure if exporting is correct or not - but it's inconsistent with what the existing /etc/init.d script does.

Yes, but according to @ryao, this is wrong to. I, and apparently @behlendorf, consider the issues he's seeing a problem with the zfs/zpool commands, not necessarily with the boot/shutdown process.

We might need to hold of a shutdown/stop/export option until we've (well, they :) have decided if this is correct behavior or not.

@behlendorf
Copy link
Contributor

I'd say that exporting the pool on shutdown ends up exposing long standing deficiencies in other parts of the tool chain. Therefore we should avoid doing so until such time as those issues are addressed. These issues are a good example of the mixing of pool configuration and state information I was alluding to in #3800. With that in mind I've merged 33df62d which prevents the export.

But that's an entirely different issue than the one describe here where both the systemd and sysv scripts are installed. From my point of view this is a decision which needs to be handled by the end distribution maintainers. My preference would be to just install either systemd of sysv support, which ever is the preferred default option for the distribution in question. However, if the maintainer wants to support both then they need to do whatever the right thing is for their distribution. It sounds like that means a symlink on Debian systems (option 2).

@FransUrbo @ggzengel so if I understand correctly then this issue can be closed because there's no need to merge anything in the upstream ZoL tree. It will be handled by the maintainers in their packaging.

@FransUrbo
Copy link
Contributor

@behlendorf If you agree to the fact that conflicts between SYSV and systemd (as in, installed simultaneous) is a distribution issue, not a ZoL issue, then I say that this can/should be closed.

@behlendorf
Copy link
Contributor

Agreed. Closing.

@behlendorf behlendorf closed this Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants