Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make init scripts work properly for Debian+OpenRC setup (again) #15977

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

heroxbd
Copy link
Contributor

@heroxbd heroxbd commented Mar 9, 2024

Motivation and Context

I intend to submit a sequel of #8359 to finally produce the correct init scripts for Debian + OpenRC setup.

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.

Past issues closed by being staled includes:
#8063
#8204

Description

It replaces the runtime check with build-time configuration, simplifying the logic to maintain initscripts of ZFS. The built init script is completely determined by the --with-vendor= option.

This construct is inspired by Mo Zhou's runtime detection of the execution shell.

How Has This Been Tested?

Debian unstable + sysv-rc: works
Debian unstable + openrc: works
Gentoo + openrc: works

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes. (not needed)
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

@heroxbd
Copy link
Contributor Author

heroxbd commented Mar 9, 2024

Hi Mo (@cdluminate), you comments would be high valuable to this PR.
Hi Arvind @nivedita76, you have authored the last factorization of the Makefile substitutions. I am moving the initscript substitution logic back to autoconf. Looking forward to your input.

man/Makefile.am Outdated Show resolved Hide resolved
Benda Xu added 2 commits March 9, 2024 20:55
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 6ef28c5.

Reference: openzfs#8063
Reference: openzfs#8204
Reference: openzfs#8359
Signed-off-by: Benda Xu <orv@debian.org>
As of 2024, the initscripts are mostly relevant on Debian, Gentoo and
their derivatives.

Signed-off-by: Benda Xu <orv@debian.org>
@cdluminate
Copy link
Contributor

My memory about the Debian OpenRC + ZFS setup is almost gone. But after going through the patch, I think there is a clear problem. The IS_SYSV_RC replacement variable is evaluated during the automake process and is permanently fixed afterwards.

Think about the following scenario: (1) the user installs Debian/gentoo with sysv-rc; (2) the user installs openzfs and the generated scripts are specific to sysv-rc; (3) the user decides to switch to openrc and zfs services just breaks silently.

Is it possible to detect this within the service scripts at the run time?

@heroxbd
Copy link
Contributor Author

heroxbd commented Mar 10, 2024

My memory about the Debian OpenRC + ZFS setup is almost gone. But after going through the patch, I think there is a clear problem. The IS_SYSV_RC replacement variable is evaluated during the automake process and is permanently fixed afterwards.

Think about the following scenario: (1) the user installs Debian/gentoo with sysv-rc; (2) the user installs openzfs and the generated scripts are specific to sysv-rc; (3) the user decides to switch to openrc and zfs services just breaks silently.

Is it possible to detect this within the service scripts at the run time?

This is not a concern, because OpenRC on debian consumes both sysv-rc and openrc initscripts. (3) won't happen.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Apr 4, 2024
@behlendorf behlendorf merged commit 162cc80 into openzfs:master Apr 8, 2024
19 of 26 checks passed
@Harry-Chen Harry-Chen mentioned this pull request Apr 22, 2024
13 tasks
tonyhutter pushed a commit that referenced this pull request May 2, 2024
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 6ef28c5.

As of 2024, the initscripts are mostly relevant on Debian, Gentoo and
their derivatives.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Benda Xu <orv@debian.org>
Issue #8063
Issue #8204
Issue #8359
Closes #15977
mmstick pushed a commit to pop-os/zfs-linux that referenced this pull request Jun 14, 2024
Attempt to upstream the patches for the Debian+OpenRC setup.

Reference: openzfs/zfs#15977
Signed-off-by: Benda Xu <orv@debian.org>
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 4, 2024
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 6ef28c5.

As of 2024, the initscripts are mostly relevant on Debian, Gentoo and
their derivatives.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Benda Xu <orv@debian.org>
Issue openzfs#8063
Issue openzfs#8204
Issue openzfs#8359
Closes openzfs#15977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants