Nothing urgent, but I think the documentation here is rather limited with respect to the daemon options.
I would say the information on the “oneshot” type is incomplete; all it mentions is that “Run once and exit after completion, notifying systemd. After completion, the daemon is still considered active and running .” However, from my own experience there are several details that are important when deciding what daemon type to use:
If the oneshot daemon fails, the installation of the snap fails (source: from own experience)
For the snap installation to complete, the daemon has to complete (source: this post)
The latter means for example, that if there is any dependencies on interfaces, it is impossible to install a snap unless the interfaces are connected automatically by snapd. In addition, I guess it means you have to make execution rather short if you want to use oneshot daemons.
On the other hand, this is interesting functionality when you want to be able to fail updates if certain conditions are not met, another reason to document it.
Maybe this information is common knowledge when familiar with systemd, but it wasn’t for me
This is true for all daemons (as it is for broken hooks too, if any step of setting up the snap at install/upgrade time fails it rolls back to the former state… (For install that means uninstall, else it goes to the former revision))
I know it is the case for hooks, but I tested it with a “simple” daemon and raising an exception does not fail the install.
Which sort of makes sense, because since the “simple” daemon runs forever, how does systemd knows how long to wait until deciding the installation is complete?
Hmm, have you tried to just put garbage into it to produce a syntax error? I would normally expect the above to make it fail but probably the python interpreter somehow stays alive with raise (systemd likely just watches the interpreter) ?