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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/Substfiles.am
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
8 changes: 5 additions & 3 deletions config/zfs-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
6 changes: 1 addition & 5 deletions etc/init.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ DESCRIPTION

They have been tested successfully on:

* Debian GNU/Linux Wheezy
* Debian GNU/Linux Jessie
* Ubuntu Trusty
* CentOS 6.0
* CentOS 6.6
* Debian GNU/Linux Bookworm
* Gentoo

SUPPORT
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-import.in
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ do_start()

# ----------------------------------------------------

if [ ! -e /sbin/openrc-run ]
if @IS_SYSV_RC@
then
case "$1" in
start)
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-load-key.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ do_stop()

# ----------------------------------------------------

if [ ! -e /sbin/openrc-run ]
if @IS_SYSV_RC@
then
case "$1" in
start)
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-mount.in
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ do_stop()

# ----------------------------------------------------

if [ ! -e /sbin/openrc-run ]
if @IS_SYSV_RC@
then
case "$1" in
start)
Expand Down
3 changes: 2 additions & 1 deletion etc/init.d/zfs-share.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ do_stop()

# ----------------------------------------------------

if [ ! -e /sbin/openrc-run ]; then
if @IS_SYSV_RC@
then
case "$1" in
start)
do_start
Expand Down
3 changes: 2 additions & 1 deletion etc/init.d/zfs-zed.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ do_reload()

# ----------------------------------------------------

if [ ! -e /sbin/openrc-run ]; then
if @IS_SYSV_RC@
then
case "$1" in
start)
do_start
Expand Down
Loading