Any ideas what’s going on? I checked the build log (I’m using the snapcraft build service for this) but there was no mention of this there. Maybe just a bug?
* restart-condition
Defines when a service should be restarted, using values returned from systemd service exit status.
Can be one of [on-failure|on-success|on-abnormal|on-abort|on-watchdog|always|never].
Also FWIW I did just manually set Restart=on-failure in my systemd unit file, which led to a bad-setting error (Debian buster). So the snapd behavior does actually appear fairly reasonable.
Yes in order to enable specifying Restart=<anything-other-than-no> for oneshot daemons, we need to effectively check what version of systemd is on the system, and if it’s a new enough one, then allow through the setting, but if not then use Restart=no.