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

Complete rewrite of init script(s) #2106

Closed
wants to merge 1 commit into from

Conversation

FransUrbo
Copy link
Contributor

Base scripts on the init scripts included with Debian GNU/Linux, then take code from the already existing ones from ZoL, trying to merge them into one.

These two scripts probably have been tested to work on Debian GNU/Linux Wheezy and Fedora 20. They have been running in the ZoL Debian GNU/Linux Wheezy packages for several versions now, and people that have been having troubles before, is now reporting success.

Closes: #2974, #2107, #2116.

@tesujimath
Copy link
Contributor

@FransUrbo A couple of comments:

  1. The NFS service on EL6 is called simply nfs, not nfs-kernel-server. That's a Debian/Ubuntu thing I think.
  2. I think the zfs-share needs integrating into the startup script for nfs. The point is, if I restart NFS, then none of my ZFS filesystems will be visible until I zfs share -a. Currently I have to do this by hand, but I think it should be done in /etc/init.d/nfs, something like this (in the start section for nfs):
        [ -x /sbin/zfs ] && /sbin/zfs share -a

That means it will just do the right thing if I service nfs restart. Otherwise things can be quite frustrating unless you spot what's going wrong here.

@FransUrbo
Copy link
Contributor Author

Thanx for the input, but I'm not sure I can do anything about point two... Fixing one right now, I'll do a force update as soon as I have something.

Adding zfs support to nfs isn't going to happen! I can't modify a file that "I" don't own! I'll look into insserv and see if it's possible to have zfs restarted anyway somehow.

But in Debian GNU/Linux I can add an 'override' file (with just the INIT info) in /etc/insserv/overrides/nfs-kernel-server that overrides the one in /etc/init.d/nfs-kernel-server.

Is that possible on Redhat based systems?

@tesujimath
Copy link
Contributor

@FransUrbo I would caution you against overrides. The problem there is that you would end up maintaining the nfs-kernel-server startup script yourself, which I'm sure isn't what you want. Much better to negotiate with the nfs package maintainer to get them to add the one line that we need to support ZFS. In Red Hat land we should probably start that discussion with the Fedora package maintainer. Yes, this is growing in scope, but I think it's necessary to get the thing done right.

@FransUrbo
Copy link
Contributor Author

@tesujimath I wasn't going to, I'm not "allowed" to that either.

And considering how many distributions there is (which I really like to be able to support in MY scripts), there's just no way I have the time (or interest!) to negotiate with tens of package maintainers...

What I CAN do however (which was my intention - provided RH etc supports overrides), is document the issue and give recommends to the user/admin.

@tesujimath
Copy link
Contributor

@FransUrbo That's fair enough. It's a distribution packaging issue really. And there's far too much fragmentation in Linux land to solve this in a sensible way. Thanks for your good effort on progressing this in a general way, anyway.

@ryao
Copy link
Contributor

ryao commented Feb 27, 2014

What is the license for these scripts? Gentoo's ebuild policy is that all licenses on installed files must be clearly marked in the ebuild. The OpenRC script was originally GPLv2 licensed, so I had to display GPLv2 alongside the CDDL in the license. That resulted in a fair degree of harassment by individuals whom I shall call "do-gooders". Consequently, I went through plenty of trouble to relicense the upstream OpenRC script for Gentoo was relicensed from GPLv2 to BSD-2. That permitted me to hide the GPLv2 bits behind USE=debug, which is disabled by default. Consequently, the harassment stopped.

I am not particularly keen on anything that could reintroduce the GPL into ZoL's OpenRC script. It might be time for Gentoo to go its own way as far as an OpenRC script are concerned. It is not that I am strictly opposed to script unification, but what we have now (when #2148 is included) is sufficient for the needs of OpenRC-based distributions.

@FransUrbo
Copy link
Contributor Author

I have no idea what the license is, technically I didn't write them. I only put different pieces together into one :).

But since a large part of it comes from the Debian GNU/Linux packages (pkg-zfs) and was written "by others" (I know @dajhorn have had a substantially large hand in them :), but also Aron Xu (official maintainer of ZoL in Debian GNU/Linux) as well as me.

Then the other half comes from the ZoL scripts that was already there...

So a combined GPL and CDDL licensing (if that's allowed) is probably not to unreasonable to assume. I'll have to double check with @dajhorn and Aron if they have any objections in releasing these (the "unification scripts") as pure CDDL. For the part(s) I wrote, I have no objections.

Unfortunately, it seems that Aron have goon a-wall and can't be contacted :(

For the parts that come from the 'old' ZoL scripts, I need to check the licensing of those and if they're not already CDDL, I need to check with those authors if it's ok to CDDL these.

@behlendorf behlendorf added this to the 0.6.4 milestone Mar 20, 2014
FransUrbo referenced this pull request in FransUrbo/zfs Mar 22, 2014
siboulet pushed a commit to siboulet/pkg-zfs that referenced this pull request Jul 19, 2014
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Aug 19, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Aug 21, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Aug 29, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 5, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 5, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 5, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 5, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 7, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 10, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 14, 2014
… init scripts included with Debian GNU/Linux

Base scripts on the init scripts included with Debian GNU/Linux
then take code from the already existing ones, trying to merge
them into one.
+ NFS server service is just called 'nfs' in Redhat based system, and
  nfs-kernel-server on Debian GNU/Linux based.
+ Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
+ Stop after umountfs
+ When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
  so the file won't exist making the script not run.
+ Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
+ The import function, do_import(), imports pools by name instead of '-a' [all].
  + Test all '/dev/disk/by-*' dirs for import.
+ Fallback on importing the pool using the cache file (if it exists) if the
  'by-id' didn't work.
+ Add exceptions to pool imports.
  then take code from the already existing ones, trying to merge
  them into one.
  + NFS server service is just called 'nfs' in Redhat based system, and
    nfs-kernel-server on Debian GNU/Linux based.
  + Merge openzfs#2148 - Inform OpenRC that ZFS uses mtab.
  + Stop after umountfs
  + When stopping, don't check for LOCKDIR/zfs-mount - it won't be mounted,
    so the file won't exist making the script not run.
  + Add a configurable ZFS_INITRD_POST_MODPROBE_SLEEP used in the initrd to sleep after the modprobe.
  + The import function, do_import(), imports pools by name instead of '-a' [all].
    + Test all '/dev/disk/by-*' dirs for import. Include /dev as a last ditch attempt.
  + Fallback on importing the pool using the cache file (if it exists) if the
    'by-id' didn't work.
  + Add exceptions to pool imports.
* ZED script from the Debian GNU/Linux packages added.
@cburroughs
Copy link
Contributor

I was trying to use the zed script on rhel6 and ran into two compatibilty:

  • /lib/init/vars.sh does not exist
  • start-stop-daemon does not exist and seems from my limited understanding to be a debian specific thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zed daemon has no init.d script
5 participants