Comment 10 for bug 1624540

Revision history for this message
Martin Pitt (pitti) wrote :

> I believe the zed systemd unit should at the very least be modified not to start inside containers

That can be done with ConditionVirtualization=!container

> (b) there were an /etc/default/zed which enabled one to disable zed altogether.

Please don't do that. /etc/default files should never have been mis-used for enabling/disabling services -- there already is update-rc.d enable/disable for that (or the more direct systemctl enable/disable now).

> we could have a unit list "RequiresFilesystem" with "zfs" and so have zfs-zed kick in as soon as any zfs mount occurs

There is no direct way to express this; but IMHO a sufficient approximation is to start it if a zfs file system exists? That can be done with an udev rule like

  ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="zfs", ENV{SYSTEMD_WANTS}+="zed.service"

Note that I don't know the precise value of ID_FS_TYPE for zpools, and the precise name of the service you want to start.