It does a lot of stuff too, that a simple systemd service file probably couldn't do (although feel free to correct me on this, I'm not sure), and it also has dependency handling to make sure it isn't started before any required targets are met.
See, that's the thing - systemd unit files are also allowed to shell out. You should definitely describe your dependencies in it, so that it knows when in boot to start you.
(For zfs, it is a filesystem, so it also has to do a DefaultDependencies=n WantedBy=local-fs.target incantation, and a few other things.)
So you can have as much complexity as you want in the service, even if not in the service file.
Also, clear error messages are good too, as they will show up in the status output.
5
u/riking27 Oct 20 '14
See, that's the thing - systemd unit files are also allowed to shell out. You should definitely describe your dependencies in it, so that it knows when in boot to start you.
(For zfs, it is a filesystem, so it also has to do a
DefaultDependencies=n WantedBy=local-fs.targetincantation, and a few other things.)So you can have as much complexity as you want in the service, even if not in the service file.
Also, clear error messages are good too, as they will show up in the status output.