Also you right about Requires, in non snapd mode I am using After and Requires and that work fine.
Forgot to say that I am adding snapd support to an existing installation procedure which works fine in this case so I have working systemd files (https://github.com/syncloud/rocketchat/tree/master/config/systemd)
You also right about start does not make service usable, but for that I have post start systemd commands and they actually wait for ports to open (I have added this to snapd fork).
Ideally I would like snapd to start my services on install in the exact order they are listed in yaml, but if before/after logic can reorder them properly I am fine with that, it just does not seem to do that.
Please read this thread from the top again. We already discussed this to some length, and thereās design and rationale in place already (discussion welcome as usual). We canāt take order of declaration as meaningful for several reasons.
Yes, and I think we have a bug about this that @mborzecki raised this morning. Today weāre starting up services manually, and doing so one-by-one. We need to fix the logic so they are all started together by snapd, which means systemd will have a chance to enforce the stated order.
That said, note that this wonāt force the startup of services if one of them is disabled. In other words, after/before only affect ordering, but not the actual dependency between services. Thatās what I was mentioning to @mborzecki above.
Yes, this is generated based on the after, before properties of apps in snap.yaml
Note that the order in which the apps are traversed when starting is not stable. Iāve opened a PR to start all services from one snap in a single systemctl call https://github.com/snapcore/snapd/pull/4594. Hopefully this will do the trick and systemd will be able to do its thing.
Iām afraid itās only in the master branch at this point. Unfortunately it was overlooked for 2.31.1 release. If you are doing builds yourself you can try cherry-picking the patches. Otherwise the changes should also be in the core from edge.
Is it relatively safe to use master?
This is for testing only, but I do not want to spend days on something non related.
Otherwise I can cherry pick it as you said.
Iām running the āmasterā builds on my Arch development box and itās mostly issue free (with the exception of the need to use core from edge occasionally), but YMMV and cherry-picking is probably an easy way out.