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.
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.
Current snapcraft syntax allows service ordering - but it has limitation: after An ordered list of applications the daemon is to be started after. **Applications must be part of the same snap.**
What if I need to adjust my app service to be started before some system service e.g. before NetworkManager.service? I can do this in non-snap systemd system, but in snap - no. Are there any plans to enable that?