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

Mounting and sharing runs at the same priority in the boot process #2107

Closed
FransUrbo opened this Issue Feb 4, 2014 · 1 comment

Comments

Projects
None yet
3 participants
@FransUrbo
Member

FransUrbo commented Feb 4, 2014

This is because there is only one script that does everything: importing, mounting and sharing.

The sharing part have the potential of failing, especially if the current script runs so early that the nfs/smb/iscsi services isn't started yet.

So the import+mount part needs to run very, very early, but the share part needs to run after the nfs/smb/iscsi services is started (quite late).

Only way to do this is to separate the three functions into two scripts.

The start of solving this is in #2106. The issue have been reported in #1375, #2092 and #2403.

Although ZoL supplies scripts, the Linux distributions is not bound to use them. So I consider this relatively low priority and first target would be 0.6.4.

@uhop

This comment has been minimized.

Show comment
Hide comment
@uhop

uhop Jun 26, 2014

For future generations: in #2403 I reported that zfs share -a helped. Actually two subsequent commands required after a reboot:

sudo zfs unshare -a
sudo zfs share -a

That's how I deal with the problem until the fix is issued, and pushed to affected distributions.

uhop commented Jun 26, 2014

For future generations: in #2403 I reported that zfs share -a helped. Actually two subsequent commands required after a reboot:

sudo zfs unshare -a
sudo zfs share -a

That's how I deal with the problem until the fix is issued, and pushed to affected distributions.

@behlendorf behlendorf modified the milestones: 0.6.5, 0.6.4 Feb 5, 2015

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 23, 2015

* 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 zfsonlinux#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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107, #2116.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 29, 2015

* 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 zfsonlinux#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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107, #2116.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 29, 2015

* 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 zfsonlinux#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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 29, 2015

* 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 zfsonlinux#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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Apr 30, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 1, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 1, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 1, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 3, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 3, 2015

3337: turbo/fixes.init_total_rewrite - Base init scripts for SYSV sys…
…tems

* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 5, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 6, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 6, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.
  + Run all scripts through ShellCheck.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 6, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.
  + All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 6, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.
  + All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 10, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.
  + All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 15, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.
  + All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  + ZED script from the Debian GNU/Linux packages added.
    + Refreshed ZED init script from behlendorf/zfs@5e7a660.
      Reworked to be portable so it may be used on LSB and Redhat style systems.
      Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 15, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  + Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  + 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.
  + All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  + ZED script from the Debian GNU/Linux packages added.
    + Refreshed ZED init script from behlendorf/zfs@5e7a660.
      Reworked to be portable so it may be used on LSB and Redhat style systems.
      Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 16, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 17, 2015

3337: turbo/fixes.init_total_rewrite - Base init scripts for SYSV sys…
…tems

* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 17, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 18, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 18, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 20, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 20, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 20, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 20, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one for better maintainability.
  * Merge zfsonlinux#2148 - Inform OpenRC that ZFS uses mtab.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 22, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code from the
  already existing ones, trying to merge them into one set of scripts that will work
  for 'everyone' for better maintainability.
  * 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.
  * All scripts passes ShellCheck (with one false positive in zfs-mount:do_mount()).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it may
      be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before importing pools.

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * Fallback on importing the pool using the cache file (if it exists) if
      any of the 'by-*' didn't work.
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before
    importing pools.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * Fallback on importing the pool using the cache file (if it exists) if
      any of the 'by-*' didn't work.
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before
    importing pools.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * Fallback on importing the pool using the cache file (if it exists) if
      any of the 'by-*' didn't work.
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before
    importing pools.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * Fallback on importing the pool using the cache file (if it exists) if
      any of the 'by-*' didn't work.
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before
    importing pools.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * Fallback on importing the pool using the cache file (if it exists) if
      any of the 'by-*' didn't work.
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before
    importing pools.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * Fallback on importing the pool using the cache file (if it exists) if
      any of the 'by-*' didn't work.
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
  * If we're running from init, remove stale /etc/dfs/sharetab before
    importing pools.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * If we're running from init, remove stale /etc/dfs/sharetab before importing
    pools.
  * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
    everything quite early in the shutdown phase and zed is/should be stopped
    much later than that. We don't want zed to be among them, so add the zed
    pid to list of pids for 'sendsigs' to ignore.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 23, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for USB devices to be availible before we load the zfs
      module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd.
      Primarily used when the filesystem needed to boot isn't directly under
      the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed.
  * The import function, do_import(), imports pools by name instead of '-a'.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among them, so add the zed
      pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with a modified IFS variable for some
      reason, so work around that when we define zfs_log_{end,failure}_msg().
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 27, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 27, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 27, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 27, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 28, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue May 28, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.

behlendorf added a commit to behlendorf/zfs that referenced this issue Jun 4, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from 5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>

Closes: #2974, #2107.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

kernelOfTruth added a commit to kernelOfTruth/zfs that referenced this issue Jun 8, 2015

Base init scripts for SYSV systems
* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
    * ZFS_INITRD_PRE_MOUNTROOT_SLEEP
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
    * ZFS_INITRD_POST_MODPROBE_SLEEP
      Set a timed sleep in the initrd to after the load of the zfs module.
    * ZFS_INITRD_ADDITIONAL_DATASETS
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
    * ZFS_POOL_EXCEPTIONS
      Exclude pools from being imported (in the initrd and/or init scripts).
    * ZFS_DKMS_ENABLE_DEBUG, ZFS_DKMS_ENABLE_DEBUG_DMU_TX, ZFS_DKMS_DISABLE_STRIP
      Set to control how dkms should build the dkms packages.
    * ZPOOL_IMPORT_PATH
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf/zfs@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
    /etc/init.d/zfs-functions.
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
    modifed.
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson turbo@bayour.com
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Chris Dunlap <cdunlap@llnl.gov>
Closes #2974
Closes #2107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment