openzfsonosx / zfs

OpenZFS on OS X

Home Page:https://openzfsonosx.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

filename for flock utility is hardcoded in source

captain-haddock17 opened this issue · comments

Got an error message from zed

logger: error: data-notify.sh: eid=15: failed to lock "/var/run/zed.zedlet.state.lock": /etc/zfs/zed.d/zed-functions.sh: line 128: /opt/homebrew/bin/flock: No such file or directory
logger: error: data-notify.sh: eid=15: failed to unlock "/var/run/zed.zedlet.state.lock": /etc/zfs/zed.d/zed-functions.sh: line 166: /opt/homebrew/bin/flock: No such file or directory

As I use MacPort instead of HomeBrew, I can not rid of these messages.
Could there be some side effects on ZFS running correctly ?

Kind regards, William

These are because the Linux zedlet scripts assume there is a flock command, which OsX doesn't have. It is harmless, but eventually if someone is eager, we should port the zedlets to OsX a bit more.

After some investigations:
flock is declared and used in file /usr/local/libexec/zfs/launchd.d/zpool-import-all.sh

  1. Got the opensources of flock and compiled it (having to get ruby and ronn. Compiled the whole thing.
  2. standard installation is /usr/local/bin
  3. corrected /usr/local/libexec/zfs/launchd.d/zpool-import-all.sh to mention new path to this utility:
128:    err="$(/usr/local/bin/flock "${fd}" 2>&1)"
166:    err="$(/usr/local/bin/flock -u "${fd}" 2>&1)"

Cheers,
William