systemd.services.znapzend = {
description = "ZnapZend - ZFS Backup Service";
documentation = "man:znapzend";
after = [ "zfs-import-dpool.service" ];
wants = [ "zfs-import-dpool.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.znapzend}/bin/znapzend --daemonize";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Restart = "on-failure";
};
};
Also, I am not happy with this because the pool name (dpool) is hard-coded into the service file. (I found the dependency on dpool by "systemctl list-units | grep zfs".) I don't know how to generalize the dependency to the import of all pools. How should I be doing it? More generally, what do you do to start the znapzen daemon?
Second question: how do you specify the setup rather than running znapzendzetup by hand?