Skip to content

Commit 5ac53c0

Browse files
committed
6: etc/* up to 2.3
Signed-off-by: Jorgen Lundman <[email protected]> Set zp->z_blksz to ashift Slowdowns in zfs_log_write() can happen on large blocksize devices. Signed-off-by: Jorgen Lundman <[email protected]> MacOS: Build with n+1 cpus (#22) Signed-off-by: Andrew Innes <[email protected]> macOS: use portable paths for brewed deps (#23) Signed-off-by: Yurii Kolesnykov <[email protected]> Search for C++ and Obj C compilers (#21) Signed-off-by: Andrew Innes <[email protected]> cpuid uses a,b,c,d order. wikipedia paragraph referred to model string, which has a special case ordering. This fixes a bug where old intel would incorretly assume AES/qmul feature was available when it was not. (And vice-verse, but this would just skip asm versions and not panic) Signed-off-by: Jorgen Lundman <[email protected]> Redo cpuid feature detection We already have a proper cpuid feature API used in userland, but Linux took it out for KERNEL use, to plug into the Linux API. We do not have a kernel API to use, so we might as well use the userland one. This makes it nice and consistent, and more easy to read. Signed-off-by: Jorgen Lundman <[email protected]> Use built in cpuid() where possible Fixing a panic when running sysctl -a Signed-off-by: Jorgen Lundman <[email protected]> UpstreamÂ: remove sprintf usage Signed-off-by: Jorgen Lundman <[email protected]> Add IRC notifications Signed-off-by: Jorgen Lundman <[email protected]> xcode 16 compile fixes function argument type changed, adapt ASSERTs assembly bug in clang-16 work around Signed-off-by: Jorgen Lundman <[email protected]> Reduce userland CPU starvation from low-priority I/Os Once we have successfully read from disk we may do significant CPU-work on the data obtained, depending on features like record sizes, checksums, encryption, or compression. A successful write may cause significant CPU-work to be done for a subsequent zio. Because our vdev_disk layer and its use of IOKit is fundamentally asynchronous, on some media modern linearized scrubs and resilvers may "gang up" on bursts of interactive user I/Os. Moreover, all zfs kernel threads are higher priority than the vast majority of userland threads, therefore the latter can be starved of CPU especially for a scrubbing pool which has a vdev count conmparable to the CPU core count and where data was wrtten using expensive checksums like sha256. Practically all our IOKit I/Os are asynchronous, but significant work may be done on the taskq thread, possibly right to the entry into the vdev_disk_io_intr() callback function. We dispatch "background" I/Os into a lower thread-priority and lower thread-count taskq compared to other types of zio. In the callback function itself, for these low-priority I/Os we kpreempt() before before calling zio_delay_interrupt(). For writes, this may impose a system-load-dependent delay on notifying upper layers of zfs that IOKit has moved the buffer towards the physical device, generating backpressure on subsequent writes. For reads, this kpreempt() gives another thread in the system a chance to run before we do potentially heavy-CPU actions (such as checksumming or decyrption) on the data IOKit has obtained from the storage device. Signed-off-by: Jorgen Lundman <[email protected]> iconfig fixes Signed-off-by: Jorgen Lundman <[email protected]> abd_os changes Signed-off-by: Jorgen Lundman <[email protected]> New ASSERTs Signed-off-by: Jorgen Lundman <[email protected]> new KMEM flag Signed-off-by: Jorgen Lundman <[email protected]> issig() now takes no args Signed-off-by: Jorgen Lundman <[email protected]> sprintf is deprecated Signed-off-by: Jorgen Lundman <[email protected]> Add UIO_DIRECT Signed-off-by: Jorgen Lundman <[email protected]> Re-arrange z_blksz in zfs_znode_alloc() Signed-off-by: Jorgen Lundman <[email protected]> Set zp->z_blksz to ashift Slowdowns in zfs_log_write() can happen on large blocksize devices. Signed-off-by: Jorgen Lundman <[email protected]> altool is deprecated, use notarytool Signed-off-by: Jorgen Lundman <[email protected]> pkg-macos OS friendly name after macOS name change Signed-off-by: Jorgen Lundman <[email protected]> Update the pkg installer scripts Signed-off-by: Jorgen Lundman <[email protected]> zfs-tests: support newer macOS readOnly root Since BigSur days, "/" on macOS is a readOnly, sealed archive which means zfs-tests can not mount the expected /testpool (which all scripts assume are at root). We can work around this by leveraging /etc/synthetic.conf to create "virtual directories". They can be mounted on, but not modified. This way *most* pool names are accounted for in zfs-tests (more will come). We also have to make log_must(rm /TESTPOOL) be optional. Signed-off-by: Jorgen Lundman <[email protected]> Revert "Re-arrange z_blksz in zfs_znode_alloc()" This reverts commit 106e765. See next commit Signed-off-by: Jorgen Lundman <[email protected]> Change zfs_log_write() blocksize for performance "len" can be set to zero in the WR_INDIRECT case, if zp->z_blksz is 0. This leads to endless loop. Signed-off-by: Jorgen Lundman <[email protected]> Revert changes to zfs_znode_alloc for reals. Signed-off-by: Jorgen Lundman <[email protected]> Make sure blocksize is not 0 in zfs_log_write() Or the while(resid) loop will run forever. Signed-off-by: Jorgen Lundman <[email protected]> Negative numcpus make taskq stall Handle limited CPU VMs with 1 or 2 cores. The cpus variable would go to -1 and taskq would stall forever. Signed-off-by: Jorgen Lundman <[email protected]> Handle versions without IOSleepWithLeeway() Signed-off-by: Jorgen Lundman <[email protected]> Allow zfs_fallthrough to be defined Signed-off-by: Jorgen Lundman <[email protected]> Don't use typedefs before OSVersion workaround Signed-off-by: Jorgen Lundman <[email protected]> Handle SF_NOUNLINK on versions without it Signed-off-by: Jorgen Lundman <[email protected]> Update pkg_macos.sh to handle notarytool Signed-off-by: Jorgen Lundman <[email protected]> Compile fixes after rebase Signed-off-by: Jorgen Lundman <[email protected]> Export before removing file Due to a macOS quirk, we have to close the files in a filebased pool during some operations, which means the export -f task will fail to open the vdevs again, the pool will be suspended and zpool_export_004_pos will hang forever. By deleting the file after export, everything works as expected. Signed-off-by: Jorgen Lundman <[email protected]> Don't hold zfs_enter() in asyncput This can deadlock during unmount, as we are already holding WRITE lock. Signed-off-by: Jorgen Lundman <[email protected]> zpool freeze can hang in spa_evicting_os_wait It appears upstream can still unmount, and export the pool - to later re-import to unfreeze. However on macOS, export will hang in spa_evicting_os_wait(). It is unclear why we hang, but it could be we go through more syncs during unmount, and that spa_freeze_txg is set to txg + TXG_SIZE Now we clear (restoring UINT64_MAX) spa_freeze_txg in the unmount() call, ensuring unmount and export works. We might not have identical "zpool freeze" as upstream, but as the zpool sources say: * 'freeze' is a vile debugging abomination, so we treat * it as such. Signed-off-by: Jorgen Lundman <[email protected]> Do not install .in files with Makefile Signed-off-by: Jorgen Lundman <[email protected]> clone file can return ENOTSUP for fallback From Sonoma onwards, file_cmds-428 will handle ENOTSUP and fallback to copyfile. Prior to that, we favour EAGAIN as it will indicate to the users that it is a temporary failure. Signed-off-by: Jorgen Lundman <[email protected]> sprintf has been deprecated Signed-off-by: Jorgen Lundman <[email protected]> Move appveyor to .github/workflows/macos-build.yml Signed-off-by: Jorgen Lundman <[email protected]> make install would fail to mkdir first. Signed-off-by: Jorgen Lundman <[email protected]> Fix .yml to start zed, and zfs-tests Signed-off-by: Jorgen Lundman <[email protected]> fix abd, have taskq_wait_synced() wait for threads to be created taskq_wait_synced() did a VERIFY() on whether the taskq's threads were the requested number, but taskq_create() can ultimately return early because taskq_thread_create() is allowed to return when two desired threads are created. fix this race panic. also, taskq_wait_synced() may fail if if num_ecores is nonzero (on Apple Silicon), so create a flag that lets taskq_create_common() deal with the max_ncpus. Make boot_ncpus a variable that's MAX(1, (int)max_ncores - num_ecores). boot_ncpus is used in common code. Modify the alignments and quanta/import sizes of the abd kmem and vmem cache creations. Make DEBUG builds work with KMF_LITE | KMF_BUFCTL on the abd kmem caches. Signed-off-by: Sean Doran <[email protected]> Allow NOTARYTOOL path to be set Apple has decided that copying notarytool from new macOS to old macOS instead of supporting altool. But sadly "xcrun" will not run it as expected, so we allow NOTARYTOOL env var to be set to a path to use. Signed-off-by: Jorgen Lundman <[email protected]> Add copy_file_range() wrapper to fcopyfile(). Signed-off-by: Jorgen Lundman <[email protected]> Compile fixes since last rebase Signed-off-by: Jorgen Lundman <[email protected]> ZIO_TYPE_IOCTL renamed to ZIO_TYPE_FLUSH And also they renamed zfs_file_fallocate() to zfs_file_deallocate() somewhere along the way. Signed-off-by: Jorgen Lundman <[email protected]> Header fix Signed-off-by: Jorgen Lundman <[email protected]> zfs_racct prototype change Signed-off-by: Jorgen Lundman <[email protected]> zfs_log_write() now takes directio boolean Signed-off-by: Jorgen Lundman <[email protected]> zfs_znode_os.c also, change strcpy back to strlcpy yet again, thanks linux. Signed-off-by: Jorgen Lundman <[email protected]> isimd_stat_init simd_stat_fini Signed-off-by: Jorgen Lundman <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Use SUBSTFILES for .in files Signed-off-by: Jorgen Lundman <[email protected]> Compile fixes for O_DIRECTIO Signed-off-by: Jorgen Lundman <[email protected]>
1 parent 52daf35 commit 5ac53c0

File tree

88 files changed

+2374
-1277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2374
-1277
lines changed

.github/workflows/macos-build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- name: configure
2929
run: |
3030
#https://stackoverflow.com/a/62591864
31-
./configure CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/gettext/lib/ -L/usr/local/opt/openssl/lib"
31+
./configure CPPFLAGS="-I${HOMEBREW_PREFIX}/opt/gettext/include -I${HOMEBREW_PREFIX}/opt/openssl/include" LDFLAGS="-L${HOMEBREW_PREFIX}/opt/gettext/lib/ -L${HOMEBREW_PREFIX}/opt/openssl/lib"
3232
- name: build
3333
run: |
34-
make -j 2
34+
make -j $(($(sysctl -n hw.ncpu)+1))
3535
#- name: install
3636
# run: |
3737
# sudo make install DESTDIR=///

.github/workflows/macos-build.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
version: 1.0.{build}
2+
branches:
3+
only:
4+
- /macOS_.*/
5+
image: macOS-Catalina
6+
build_script:
7+
- sh: >-
8+
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
9+
10+
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-vnc.sh' | bash -e -
11+
12+
13+
HOMEBREW_NO_AUTO_UPDATE=1
14+
15+
export HOMEBREW_NO_AUTO_UPDATE
16+
17+
HOMEBREW_NO_INSTALL_CLEANUP=1
18+
19+
export HOMEBREW_NO_INSTALL_CLEANUP
20+
21+
brew install gsed
22+
23+
echo "Running from .github/workflows/macos-build.yml"
24+
25+
sh autogen.sh
26+
27+
28+
./configure CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/[email protected]/include" LDFLAGS="-L/usr/local/opt/gettext/lib/ -L/usr/local/opt/[email protected]/lib" CFLAGS="-Wno-error -g -O2" --sysconfdir=/etc --localstatedir=/var --prefix=/usr/local/zfs/ --sbindir=/usr/local/zfs/bin -libexecdir=/usr/local/zfs/libexec --enable-debug SED=gsed
29+
30+
31+
echo "Checking codestyle"
32+
33+
make cstyle || exit 1
34+
35+
36+
37+
make -j2 # V=1
38+
39+
40+
41+
sudo make -j2 V=1 install
42+
test_script:
43+
- sh: >-
44+
# log stream --source --predicate 'sender == "zfs"' --style compact &
45+
46+
47+
echo "Loading kernel modules..."
48+
49+
sudo scripts/load_macos.sh || exit 1
50+
51+
sleep 5
52+
53+
echo "Running zfs-tests..."
54+
55+
export SHELL=/bin/ksh
56+
57+
58+
sudo /usr/local/zfs/bin/zed -fF &
59+
60+
sudo mkdir -p /etc/synthetic.d/
61+
62+
sudo touch /etc/synthetic.d/zfs-tests
63+
64+
scripts/zfs-tests.sh -r macOS-CI || echo "Tests not quite right"
65+
66+
67+
sysctl kern.stack_depth_max
68+
69+
70+
sysctl kstat > kstat.txt
71+
72+
73+
7z a kext.zip /tmp/zfs.kext/
74+
75+
7z a zfs-tests.zip /var/tmp/test_results/current/ kstat.txt
76+
77+
ls -la
78+
79+
80+
echo "Attempting to unload"
81+
82+
sudo /usr/local/zfs/bin/zpool export -fa
83+
84+
sudo kextunload -b org.openzfsonosx.zfs || echo "Unload failed".
85+
artifacts:
86+
- path: kext.zip
87+
name: kext
88+
- path: zfs-tests.zip
89+
name: zfstest-log

.github/workflows/notify-irc.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
name: Notify IRC
3+
4+
on:
5+
push:
6+
issues:
7+
types:
8+
- opened
9+
- edited
10+
- closed
11+
issue_comment:
12+
pull_request:
13+
discussion:
14+
types:
15+
- created
16+
- edited
17+
- closed
18+
- answered
19+
discussion_comment:
20+
create:
21+
delete:
22+
23+
jobs:
24+
notify-irc:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Notify IRC
29+
uses: openzfsonwindows/notify-irc@v2
30+
with:
31+
channel: "#openzfs-macos"
32+
server: "irc.libera.chat"
33+
nickname: "zfs_consus"
34+
mirccolor: "true"
35+
eventpath: ${{ github.event_path }}
36+

cmd/zpool/os/macos/zpool_vdev_os.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,24 @@ after_zpool_upgrade(zpool_handle_t *zhp)
199199
{
200200
(void) zhp;
201201
}
202+
203+
int
204+
zpool_power_current_state(zpool_handle_t *zhp, char *vdev)
205+
{
206+
207+
(void) zhp;
208+
(void) vdev;
209+
/* Enclosure slot power not supported on macOS yet */
210+
return (-1);
211+
}
212+
213+
int
214+
zpool_power(zpool_handle_t *zhp, char *vdev, boolean_t turn_on)
215+
{
216+
217+
(void) zhp;
218+
(void) vdev;
219+
(void) turn_on;
220+
/* Enclosure slot power not supported on macOS yet */
221+
return (ENOTSUP);
222+
}

config/zfs-build.m4

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -557,33 +557,17 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
557557
558558
AC_MSG_CHECKING([default package type])
559559
case "$VENDOR" in
560-
<<<<<<< HEAD
561560
alpine|arch|artix|gentoo|lunar|slackware)
562561
DEFAULT_PACKAGE=tgz ;;
563562
debian|ubuntu)
564563
DEFAULT_PACKAGE=deb ;;
565564
freebsd)
566565
DEFAULT_PACKAGE=pkg ;;
566+
apple)
567+
DEFAULT_PACKAGE=pkg ;;
567568
*)
568569
# fedora|openeuler|redhat|sles|toss
569570
DEFAULT_PACKAGE=rpm ;;
570-
=======
571-
toss) DEFAULT_PACKAGE=rpm ;;
572-
redhat) DEFAULT_PACKAGE=rpm ;;
573-
fedora) DEFAULT_PACKAGE=rpm ;;
574-
gentoo) DEFAULT_PACKAGE=tgz ;;
575-
alpine) DEFAULT_PACKAGE=tgz ;;
576-
arch) DEFAULT_PACKAGE=tgz ;;
577-
sles) DEFAULT_PACKAGE=rpm ;;
578-
slackware) DEFAULT_PACKAGE=tgz ;;
579-
lunar) DEFAULT_PACKAGE=tgz ;;
580-
ubuntu) DEFAULT_PACKAGE=deb ;;
581-
debian) DEFAULT_PACKAGE=deb ;;
582-
freebsd) DEFAULT_PACKAGE=pkg ;;
583-
openeuler) DEFAULT_PACKAGE=rpm ;;
584-
apple) DEFAULT_PACKAGE=pkg ;;
585-
*) DEFAULT_PACKAGE=rpm ;;
586-
>>>>>>> 5b2f117f5... 4: config/* scripts/* contrib/*
587571
esac
588572
AC_MSG_RESULT([$DEFAULT_PACKAGE])
589573
AC_SUBST(DEFAULT_PACKAGE)
@@ -620,7 +604,6 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
620604
621605
AC_MSG_CHECKING([default init config directory])
622606
case "$VENDOR" in
623-
<<<<<<< HEAD
624607
alpine|artix|gentoo)
625608
initconfdir=/etc/conf.d
626609
;;
@@ -630,24 +613,12 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
630613
freebsd)
631614
initconfdir=$sysconfdir/rc.conf.d
632615
;;
616+
apple)
617+
initconfdir=${prefix}/etc/launchd/launchd.d/ ;;
633618
*)
634619
# debian|ubuntu
635620
initconfdir=/etc/default
636621
;;
637-
=======
638-
alpine) initconfdir=/etc/conf.d ;;
639-
gentoo) initconfdir=/etc/conf.d ;;
640-
toss) initconfdir=/etc/sysconfig ;;
641-
redhat) initconfdir=/etc/sysconfig ;;
642-
fedora) initconfdir=/etc/sysconfig ;;
643-
sles) initconfdir=/etc/sysconfig ;;
644-
openeuler) initconfdir=/etc/sysconfig ;;
645-
ubuntu) initconfdir=/etc/default ;;
646-
debian) initconfdir=/etc/default ;;
647-
freebsd) initconfdir=$sysconfdir/rc.conf.d;;
648-
apple) initconfdir=${prefix}/etc/launchd/launchd.d/ ;;
649-
*) initconfdir=/etc/default ;;
650-
>>>>>>> 5b2f117f5... 4: config/* scripts/* contrib/*
651622
esac
652623
AC_MSG_RESULT([$initconfdir])
653624
AC_SUBST(initconfdir)

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ AM_PROG_AS
5555
AM_PROG_CC_C_O
5656
AX_CODE_COVERAGE
5757
_AM_PROG_TAR(pax)
58-
AC_PROG_CXX(clang++)
59-
AC_PROG_OBJC(clang)
60-
AC_PROG_OBJCXX(clang++)
58+
AC_PROG_CXX
59+
AC_PROG_OBJC
60+
AC_PROG_OBJCXX
6161

6262
ZFS_AC_LICENSE
6363
ZFS_AC_CONFIG

contrib/macOS/pkg-scripts/postinstall_actions/kextspost

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ else
1111
fi
1212
fi
1313

14+
# kmutil onwards, kextstat prints it Executes kmutil, and no variant
15+
# but that is to stderr, so does not get seen by "wc".
1416
if [ $(/usr/sbin/kextstat -b org.openzfsonosx.zfs | wc -l) -gt 1 ] ; then
1517
printf "\nUnloading zfs.kext...\n"
1618
/sbin/kextunload -b org.openzfsonosx.zfs
@@ -31,14 +33,12 @@ printf "\nTouching %s\n" "${kernelextensionsdir}"
3133
/usr/bin/killall -HUP kextd
3234

3335
# Load kext
34-
printf "\nLoading spl.kext...\n"
35-
/usr/bin/kextutil "${kernelextensionsdir}/zfs.kext" 2>&1 | grep -q "rejected due to system policy"
36+
printf "\nLoading openzfs.kext...\n"
37+
/usr/bin/kextutil "${kernelextensionsdir}/openzfs.kext" 2>&1 | grep -q "rejected due to system policy"
3638

37-
if [[ $? -eq 0 ]]; then
38-
open /System/Library/PreferencePanes/Security.prefPane
39-
else
40-
printf "\nLoading zfs.kext...\n"
41-
/sbin/kextload "${kernelextensionsdir}/zfs.kext"
42-
fi
39+
err=$?
40+
echo "kexutil said $err"
41+
42+
open /System/Library/PreferencePanes/Security.prefPane
4343

4444
exit 0

contrib/macOS/pkg-scripts/postinstall_actions/loadplists

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
date '+%s' >> /tmp/o3x.log
33
echo $0 >> /tmp/o3x.log
44

5-
launchctl list | grep org.openzfsonosx.zconfigd 1>/dev/null
5+
launchctl list org.openzfsonosx.zconfigd 1>/dev/null
66
[ $? -eq 0 ] && /bin/launchctl remove org.openzfsonosx.zconfigd
77

88
/bin/launchctl load -w /Library/LaunchDaemons/org.openzfsonosx.zconfigd.plist
99

10-
launchctl list | grep org.openzfsonosx.zed.service 1>/dev/null
10+
launchctl list org.openzfsonosx.zed.service 1>/dev/null
1111
[ $? -eq 0 ] && /bin/launchctl remove org.openzfsonosx.zed.service
1212

13-
launchctl list | grep org.openzfsonosx.zed 1>/dev/null
13+
launchctl list org.openzfsonosx.zed 1>/dev/null
1414
[ $? -eq 0 ] && /bin/launchctl remove org.openzfsonosx.zed
1515

1616
/bin/launchctl load -w /Library/LaunchDaemons/org.openzfsonosx.zed.plist
1717

18-
launchctl list | grep org.openzfsonosx.InvariantDisks 1>/dev/null
18+
launchctl list org.openzfsonosx.InvariantDisks 1>/dev/null
1919
[ $? -eq 0 ] && /bin/launchctl remove org.openzfsonosx.InvariantDisks
2020

2121
/bin/launchctl load -w /Library/LaunchDaemons/org.openzfsonosx.InvariantDisks.plist
2222

23-
launchctl list | grep org.openzfsonosx.zpool-autoimport 1>/dev/null
23+
launchctl list org.openzfsonosx.zpool-autoimport 1>/dev/null
2424
[ $? -eq 0 ] && /bin/launchctl remove org.openzfsonosx.zpool-autoimport
2525

26-
launchctl list | grep org.openzfsonosx.zpool-import-all 1>/dev/null
26+
launchctl list org.openzfsonosx.zpool-import-all 1>/dev/null
2727
[ $? -eq 0 ] && /bin/launchctl remove org.openzfsonosx.zpool-import-all
2828

2929
/bin/launchctl load -w /Library/LaunchDaemons/org.openzfsonosx.zpool-import-all.plist

contrib/macOS/pkg-scripts/postinstall_actions/startzed

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
#!/bin/bash
22

3+
# zed is now run by launctl, so this script should not be required.
4+
exit 0
5+
6+
ZED=/usr/local/zfs/bin/zed
7+
38
set +e
49
pgrep zed 1>/dev/null
510
pgrepret=$?
611
set -e
712

813
if [ $pgrepret -ne 0 ] ; then
914
echo "zed not started"
10-
if [ -f /usr/sbin/zed ] ; then
15+
if [ -f $ZED ] ; then
1116
echo "Starting zed ..."
12-
/usr/sbin/zed
17+
$ZED
1318
else
14-
echo "zed binary /usr/sbin/zed not found"
19+
echo "zed binary $ZED not found"
1520
fi
1621
else
1722
echo "zed already running"

etc/launchd.d/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
zpool-import-all.sh

etc/launchd.d/Makefile.am

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
noinst_launch_ddir = \
3+
$(launchdscriptdir)/
4+
5+
do_subst = -$(SED) -e 's,@bindir\@,$(bindir),g' \
6+
-e 's,@runstatedir\@,$(runstatedir),g' \
7+
-e 's,@sbindir\@,$(sbindir),g' \
8+
-e 's,@sysconfdir\@,$(sysconfdir),g' \
9+
-e 's,@launchdscriptdir\@,$(launchdscriptdir),g'
10+
11+
CLEANFILES += %D%/zpool-import-all.sh
12+
13+
INSTALL_DATA_HOOKS += zpool-import-all.sh
14+
15+
zpool-import-all.sh: %D%/zpool-import-all.sh.in
16+
-$(AM_V_at)$(MKDIR_P) $(DESTDIR)/$(launchdscriptdir)/
17+
-$(AM_V_GEN)$(SED) -e 's,@bindir\@,$(bindir),g' \
18+
-e 's,@runstatedir\@,$(runstatedir),g' \
19+
-e 's,@sbindir\@,$(sbindir),g' \
20+
-e 's,@sysconfdir\@,$(sysconfdir),g' \
21+
-e 's,@launchdscriptdir\@,$(launchdscriptdir),g' \
22+
'$<' > $(DESTDIR)/$(launchdscriptdir)/'$@'
23+
chmod +x $(DESTDIR)/$(launchdscriptdir)/'$@'

0 commit comments

Comments
 (0)