-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenRC no longer breaks the ZFS initscripts on Debian.
Attempt to upstream the patches for the Debian+OpenRC setup. Reference: openzfs/zfs#15977 Signed-off-by: Benda Xu <orv@debian.org>
- Loading branch information
Benda Xu
committed
Mar 9, 2024
1 parent
eebb775
commit a30f58b
Showing
4 changed files
with
134 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
debian/patches/0016-etc-init.d-decide-which-variant-to-use-at-build-time.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
From: Benda Xu <orv@debian.org> | ||
Date: Sat, 9 Mar 2024 20:38:19 +0800 | ||
Subject: etc/init.d: decide which variant to use at build time. | ||
|
||
Let Debian use the sysv-rc variant of the script, even when OpenRC is | ||
installed. Unlike on Gentoo, OpenRC on Debian consumes both the | ||
sysv-rc scripts and OpenRC ones. ZFS initscripts on Debian should be | ||
the sysv-rc version to provide most compatibility and to integrate | ||
with the rest of initscripts for dependency tracking. | ||
|
||
Restrict the substitution in the Makefile to the dedicated list. | ||
|
||
This construct is inspired by Mo Zhou's detection of the execution | ||
shell and follows the strategy of Peter in 6ef28c526ba7. | ||
|
||
Author: Benda Xu <orv@debian.org> | ||
Forwarded: https://github.com/openzfs/zfs/pull/15977 | ||
Reference: https://github.com/openzfs/zfs/issues/8063 | ||
Reference: https://github.com/openzfs/zfs/issues/8204 | ||
Reference: https://github.com/openzfs/zfs/pull/8359 | ||
--- | ||
config/Substfiles.am | 1 + | ||
config/zfs-build.m4 | 8 +++++--- | ||
etc/init.d/zfs-import.in | 2 +- | ||
etc/init.d/zfs-load-key.in | 2 +- | ||
etc/init.d/zfs-mount.in | 2 +- | ||
etc/init.d/zfs-share.in | 3 ++- | ||
etc/init.d/zfs-zed.in | 3 ++- | ||
7 files changed, 13 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/config/Substfiles.am b/config/Substfiles.am | ||
index 38e870b..18422bf 100644 | ||
--- a/config/Substfiles.am | ||
+++ b/config/Substfiles.am | ||
@@ -18,6 +18,7 @@ subst_sed_cmd = \ | ||
-e 's|@ASAN_ENABLED[@]|$(ASAN_ENABLED)|g' \ | ||
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \ | ||
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' \ | ||
+ -e 's|@IS_SYSV_RC[@]|$(IS_SYSV_RC)|g' \ | ||
-e 's|@LIBFETCH_DYNAMIC[@]|$(LIBFETCH_DYNAMIC)|g' \ | ||
-e 's|@LIBFETCH_SONAME[@]|$(LIBFETCH_SONAME)|g' \ | ||
-e 's|@PYTHON[@]|$(PYTHON)|g' \ | ||
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 | ||
index 5f36569..bb5a85d 100644 | ||
--- a/config/zfs-build.m4 | ||
+++ b/config/zfs-build.m4 | ||
@@ -578,13 +578,15 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ | ||
|
||
AC_MSG_CHECKING([default shell]) | ||
case "$VENDOR" in | ||
- gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";; | ||
- alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";; | ||
- *) DEFAULT_INIT_SHELL="/bin/sh" ;; | ||
+ gentoo|alpine) DEFAULT_INIT_SHELL=/sbin/openrc-run | ||
+ IS_SYSV_RC=false ;; | ||
+ *) DEFAULT_INIT_SHELL=/bin/sh | ||
+ IS_SYSV_RC=true ;; | ||
esac | ||
|
||
AC_MSG_RESULT([$DEFAULT_INIT_SHELL]) | ||
AC_SUBST(DEFAULT_INIT_SHELL) | ||
+ AC_SUBST(IS_SYSV_RC) | ||
|
||
AC_MSG_CHECKING([default nfs server init script]) | ||
AS_IF([test "$VENDOR" = "debian"], | ||
diff --git a/etc/init.d/zfs-import.in b/etc/init.d/zfs-import.in | ||
index a9a0604..ff169eb 100755 | ||
--- a/etc/init.d/zfs-import.in | ||
+++ b/etc/init.d/zfs-import.in | ||
@@ -307,7 +307,7 @@ do_start() | ||
|
||
# ---------------------------------------------------- | ||
|
||
-if [ ! -e /sbin/openrc-run ] | ||
+if @IS_SYSV_RC@ | ||
then | ||
case "$1" in | ||
start) | ||
diff --git a/etc/init.d/zfs-load-key.in b/etc/init.d/zfs-load-key.in | ||
index 53c7766..27dfeeb 100755 | ||
--- a/etc/init.d/zfs-load-key.in | ||
+++ b/etc/init.d/zfs-load-key.in | ||
@@ -104,7 +104,7 @@ do_stop() | ||
|
||
# ---------------------------------------------------- | ||
|
||
-if [ ! -e /sbin/openrc-run ] | ||
+if @IS_SYSV_RC@ | ||
then | ||
case "$1" in | ||
start) | ||
diff --git a/etc/init.d/zfs-mount.in b/etc/init.d/zfs-mount.in | ||
index a0825f1..6a3ca5f 100755 | ||
--- a/etc/init.d/zfs-mount.in | ||
+++ b/etc/init.d/zfs-mount.in | ||
@@ -114,7 +114,7 @@ do_stop() | ||
|
||
# ---------------------------------------------------- | ||
|
||
-if [ ! -e /sbin/openrc-run ] | ||
+if @IS_SYSV_RC@ | ||
then | ||
case "$1" in | ||
start) | ||
diff --git a/etc/init.d/zfs-share.in b/etc/init.d/zfs-share.in | ||
index 8897807..06c59c6 100755 | ||
--- a/etc/init.d/zfs-share.in | ||
+++ b/etc/init.d/zfs-share.in | ||
@@ -57,7 +57,8 @@ do_stop() | ||
|
||
# ---------------------------------------------------- | ||
|
||
-if [ ! -e /sbin/openrc-run ]; then | ||
+if @IS_SYSV_RC@ | ||
+then | ||
case "$1" in | ||
start) | ||
do_start | ||
diff --git a/etc/init.d/zfs-zed.in b/etc/init.d/zfs-zed.in | ||
index e9cf886..3d40600 100755 | ||
--- a/etc/init.d/zfs-zed.in | ||
+++ b/etc/init.d/zfs-zed.in | ||
@@ -93,7 +93,8 @@ do_reload() | ||
|
||
# ---------------------------------------------------- | ||
|
||
-if [ ! -e /sbin/openrc-run ]; then | ||
+if @IS_SYSV_RC@ | ||
+then | ||
case "$1" in | ||
start) | ||
do_start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
debian/patches/unapplied/init-debian-openrc-workaround.patch
This file was deleted.
Oops, something went wrong.